- Home /
Game project directory filesize x10 increase after IL2CPP compilation
I use to save the whole directory of my project for backup reasons.
Zipped it has always been around 7Mb filesize. Last week after compiling the APK using IL2CPP the APK build itself file slightly decreased, while the project folder zipped is now nearly 80 Mb. Investigating the reason I discover that a new IL2CPP folder (il2cpp_android_armeabi-v7a) is created under Library subfolder. That folder unzipped is 240 Mb and mainly contains IL2CPP cache files.
Now the problem is that even if I revert the editor settings by not using IL2CPP anymore still the project folder retains the IL2CPP cache.
2 questions:
Is there a way to avoid Unity to save the IL2CPP cache folder?
If I delete that folder will I still be able to import the project without any loss?
Any answer will be appreciated. Thank you
Answer by JoshPeterson · May 02, 2018 at 11:52 AM
Is there a way to avoid Unity to save the IL2CPP cache folder?
No, the IL2CPP build cache will be created for each build. There is no option to disable it.
If I delete that folder will I still be able to import the project without any loss?
Yes, the cache folder is not necessary to import or build a project.
Note that the IL2CPP cache folder is not part of the APK. It exists to support incremental building, so that subsequently builds will be faster than the initial build, when the source code does not change. I would not recommend deleting it.
Yes I will leave it in the "live" folder. But now I can safely remove it from backups. Thank you for the prompt reply Josh.
@JoshPeterson Sorry to revive an old thread. But I'm having the same situation, my il2cpp folder is now at 11GB. Is there any way to reduce the size? Is that 11GB all necessary or is it possible there's older data that's no longer needed?
Thanks
That does seem pretty large. I would recommend deleting the folder. The next time you build it will be re-populated with the $$anonymous$$imum amount of object files necessary. Hopefully that is much less than 11 GB!
Thanks for the advice :)
Just out of curiosity, what do you think about a Unity Editor tool that can "smartly" flush the cache folders?
$$anonymous$$y $$anonymous$$etadata folder is 9GB, PlayerDataCache folder is 7.5GB and Shader Cache folder is 1Gb.