Android Apk file size very large, unnecessary assets comressed in APK?

Hi, I recently discovered that the .apk size for my project has jumped to >200mb. I checked the Editor.log and there is a total of 264.8mb of textures listed. Now the thing is I have a bunch of assets from asset store loaded in my project, but I use just a small amount of that stuff in my actual scenes. Lot of the stuff listed is used in some example scenes for those 3rd paty assets… However Unity seems to somehow include a lot of textures in to the .apk build making its size extremely large…

Also in my Editor.log I can not find lines that tell me how much file size any of my scenes is using…

I was under the impression that during build Unity only includes assets necesary for build scenes.

Yes, it’s true that Unity will only include things that are:

  • referenced in a scene that is included in the build settings.
  • inside a Resources folder.

Keep in mind that both points can have indirect references. For example If you have textures which you don’t use somewhere in your project (not in a Resources folder) They usually aren’t included. But if you have a prefab that either is inside the Resources folder or that is referenced by a variable of a script attached to an object in the scene or inside the Resources folder, the prefab as well as the textures are included as well.

So make sure you don’t have those example scenes listed in your buildsettings and That you don’t have any of those things in a Resources folder. Keep in mind that there can be multiple Resources folders across your project.