asmadsen / react-native-unity-view

MIT License
203 stars 129 forks source link

UnityExport file size for iOS too big #65

Closed shhhiiiii closed 2 years ago

shhhiiiii commented 3 years ago

Need help how to reduce the file size of unity export for ios? I have a simple unity project and when i build a unity export for ios it way too big nearly 1G.

Mostly because of libraries folder alone have 700MB

Screenshot 2021-09-09 at 17 42 33
pjc0247 commented 2 years ago

https://docs.unity3d.com/Manual/ReducingFilesize.html

shhhiiiii commented 2 years ago

@pjc0247 Thank you for your reply. I appreciate it. I have tried and optimize most of my UI game asstes and even avoided using Generics calls. The unity file it self is small but my problem is that when it is exported into ios.

I have found this disscusion about the unity ios export. https://forum.unity.com/threads/unity-ios-exported-xcode-project-is-too-huge.1029433/ it doesn't give the exact answer on how to optimize but the explaination make sense.

pjc0247 commented 2 years ago

@shhhiiiii Did you checked your build log? it shows every resource's size like below:

image

Packaged size is larger than original resources. becuase they are not png or jpg anymore. They converted into GPU compatible compression format which means more filesize. So, comparing sizes between original project and built result is mostly useless.

Second reason, https://forums.expo.dev/t/ipa-file-is-too-large/11921 https://stackoverflow.com/a/47530132

Although size of the IPA is big, once uploaded to App Store the download size for final users is much smaller. (250 MB vs 30 MB)
Yes thats absolutely normal. App thining is done at the app store level. Whenever you create .ipa file it consists of all the configurations needed for all the devices it supports. But whenever a user will download the app from the store he/she will get app size of lesser size , as only the relevant config would have been installed.

it's pretty normal that iOS program size is larger than Android's.

shhhiiiii commented 2 years ago

@pjc0247 yeah I have checked build logs and its show that libraries folders biggest file size. ( libil2cpp.a and libiPhone-lib.a)

Yeah I have figure out that there's nothing I can do on reducing the file size. My problem is that I cant commit iOs unity export in our repo since it is way to big. So I just have an alternative solution on how I can transfer unity export folder in our repo.

Thank again for your response, :)