Issue: non-Java resources from jar libraries are not included in final apk

Recently I found that non-java resources (e.g. images, properties, xml configurations) from included jar libraries are not copied to the final apk during Unity Android build. As a result as soon as we try to load them from a java side - application crashes with I/WindowState﹕ WIN DEATH: Window... exception.

During native Android SDK development, we had the similar issue but it was easily solved by additional gradle configuration. In case of Unity, there is no easy way to modify apk build process.

There was a similar issue reported before. Suggested solution was to copy missing resources to Assets/StreamingAssets folder, but it’s not going to work for us because we’re using third party jar We need to find a way to modify apk build process.

Just for reference, here is a simplified (complete workflow) diagram for Android apk build process:


Sample Unity project can be downloaded here.

Any ideas how to solve this issue?

I think you can unpack the jar and copy its the contents of its res/ folder to Plugins/Android/res/

Actually no. There is no res/ folder inside a jar. In our case, we’re missing java properties file located in com.company package (aka com/company/ folder).

I ran into exactly the same issue and filled bug report case 679543.

In my case the JAR contains “strings.properties” and “strings_zh.properties” which are not being included.

In our case, we were missing .properties file as well. As we had access to library source code, we hardcoded values from properties file directly to java code.

It’s a quick fix rather than a solution but had to deal with a problem ASAP.

So did anyone find a workaround for this?

I’ve got 3 .properties files in a jar file that I think Unity might be removing. How can I stop that happening?