- Home /
Unused assets appear in Editor.log
I've been looking for ways to optimize my build size (I'm talking about my .apk filesize since it's a mobile app), I've been through quite a few articles and forum topics, I get that the Editor.log file is quite crucial to understand what assets create such a large .apk file, but apparently there are still some things I can't get my head around. If anyone could be so kind to clear these to me I would be more than grateful.
I must say that I'm working on a HUGE project, with about a hundred scenes, lots of plugins etc, BUT 99% of these scenes are marked as addressable scenes and are downloaded on demand in-game from an online server. My build consists only of 2 scenes, one "menu" scene and one intermediate scene. Both theses scenes are quite simple in terms of assets, a few buttons and UI sprites. Nevertheless, a build consisting only of these two scenes results in a ~100MB .apk file.
To make testing more easy I build the project with just the menu scene. 108MB apk file. My Assets/Resources folder contains only .asset files, each of them ~1kb in size.
I open the Editor.log file and try to make sense of the Build Report: I'm looking at the files under the "Used Assets and files from the Resources folder, sorted by uncompressed size:" line.
The largest file in the list is a 6.9MB jpg file which is located in Assets/.../.../PluginFolder/.../Resources/Images/Help folder. Can anyone tell me why this is packed with my .apk file. Does it have to with the fact that it's in a subfolder to a "Resources" folder, even if this is nowhere near the Assets/Resources folder? Or does it have to do that it's a plugin and it pre-installs itself even if it's not used at all in the scene included in the build settings?
Second file is also a jpeg file, also not used in my menu scene (right click > find references in scene results in nothing) which is located in Assets/..../..../..../..../..../, none of the folders is named Resources or any of the "Special Folders" mentioned here: https://docs.unity3d.com/Manual/ScriptCompileOrderFolders.html
I get some .psd files from some Assets/.../.../.../GuiPackFolder/Sprites/Items/ which are not only irrelevant to my menu scene, but not used in any of my scenes.
I know I could just go and delete every single one of them, but since the list is HUGE, and they are not at all used in my project wouldn't it make more sence to not be included in my .apk build in the first place? Is there anything else I'm missing?
Any file that is in any directory called Resources in your project will be included in the build, regardless of whether it's referenced in a scene or not.
Any file that is referenced in a scene (or referenced by a reference and so on) will also be included in your build.
Answer by BjoUnity3d · Nov 10, 2021 at 05:36 PM
I'm sure you got the answer by now but the folder name: Resources can be used anywhere, not just in Assets. Anything in there will be included. But the reason I'm posting is I have a similar problem where assets that are NOT in a Resources folder and NOT anywhere in any scene, verified with various utilities, are being included in that list in Editor.Log and in my build. It's driving me insane if anyone has a solution.
Okay I think it was me not understanding how Editor.log works. It continues to grow until you exit Unity and go back in. So I was looking at old build information and thinking the stuff I removed from the scene was still being included.