iOS build size increase because of PVRTC texture format not recognised by Unity Could

Hi,

I have been making iOS builds of my game using latest unity (5.3.2) and Xcode 7.2 with bit code enabled to true. The app size was 69.8MB. Now with CloudBuild the IPA became 283.9MB. I do agree that bitcode increases app size but same setting on my machine gives 69.8MB and cloud build is 283.

In cloud build log i did notice one thing
[Unity] WARNING: PVRTC texture format is not supported, decompressing texture

We use PVRTC4 bits for almost all texture since its the best format for IOS. Is there an issue with Unity Could to understand this format?

I guess cloud build is un-compressing all textures which results in huge app size increase

1 Like

Thanks for the post, as said we currently work on the problem, we will keep you updated on this issue in this thread! :sunglasses:

1 Like

Also noticed the same problem with my projects as well.
Now I know it’s a bug before I even started investigating…

Similar issue we are getting with Android build (ETC2 format).

[Unity] WARNING: ETC2 texture format is not supported, decompressing texture
1951: [Unity] WARNING: ETC2 texture format is not supported, decompressing texture
1952: [Unity] WARNING: ETC2 texture format is not supported, decompressing texture
1953: [Unity] WARNING: ETC texture format is not supported, decompressing texture
1954: [Unity] WARNING: ETC texture format is not supported, decompressing texture

tl;dr
PVRTC/ETC2 warnings can be ignored and do not have anything todo with your final build size.

Long Story:
E.g. Editor is set to iOS platform, textures are set to PVRTC for iOS. So Unity encodes textures as PVRTC while in the Editor, the catch is the Editor is currently running on a Mac which natively does not support PVRTC (only iOS and some Androids do), so for the Editor to display those textures, it has to decompress them on the CPU, thus that warning. This happens in all cases: Cloud, local builds, etc so you will see those warnings in your local Editor.log as well.

So the size difference is certainly not related to the warnings. What’s the size on Android? Did you check the bitcode option as mentioned here?

You can also use the otool reports to find out if your assets are not compressed or if your binary has the size increased. Read more about it here.

1 Like

We are seeing similar size increases in our builds. For example, the cloud build reads as 199mb while the same project, built locally with xcode has a size of 15mb. This has been happening for about a month, since we upgraded to using 5.3 from 5.2. Any advise would be welcome.

Hey All,

Just jumping in to add a bit more detail about Local Build vs Unity Cloud Build (UCB) size for the iOS platform.

First some history and details:
Apple released tvOS and watchOS just recently and with it a new requirement for app submission: bitcode compile.
What is bitcode? Simple:

So that basically means that it will not compile the app completely into a final, tiny binary, but into a state that contains a lot more information. This additional information when uploaded allows Apple to generate multiple final, tiny binaries to target very specific devices. For example: There is no reason to include the larger art files if the device downloading the app only uses the smaller formatted files.

Now bitcode compile is not required for iOS currently, but in the future it might be required. Also as of Xcode 7, bitcode is enabled on all platforms by default. There is also one catch on this as well, bitcode is only generated in Archive builds. These builds are the final builds of your application that will be sent to the App store, and also this is what UCB uses to build your applications too. This way once you are done testing a build from UCB, you can turn around and submit it to the App store with no additional work on your part. So when you are doing builds locally, you are most likely doing just a quick Run build as seen in the below image. This build will not generate bitcode, and will be close to the final download size of your application from the App store. If you do an Archive build, you will end up with bitcode and all that will match the file you downloaded from UCB. Now if you really want UCB to not generate bitcode, David linked to a post build processor that will disable bitcode: Unity 5.3.x build size increase FAQ - Unity Engine - Unity Discussions

Thanks Ryanc and David for your response. Just to mention that i am archiving local build with bit code enabled. I have gone through earlier posts. I know bit code increases build size which is then stripped on apple’s server. I am still not sure what is causing build size increase. I will probably try an empty project. Will build it locally with bit code enabled and then via cloud build and see size differences. I will post my observations here.

3 Likes

What is the size when you do an Archive build locally and a Run build locally? Also what are you targeting when you are building locally? (Example: In my previously attached image, I have “Generic iOS Device” targeted.)

Hi there! Sorry for resurrecting this post, but I"m having a similar pseudo-issue.

May I ask, how did you fix that? Is it a hint or a clue indicating some other kind of anomaly?
Thanks :slight_smile:

Best,
Alex

Hi there,

I see these warnings on my cloud build for iOS. So so many lines of it. Will they be removed at one point? I have the feeling the build duration is lengthened due to these errors but to be honest I don’t know the answer to this of course as it’s a wild speculation on my part. I would like to know if anything is being done about it. Should we worry or are we still ignoring it and you are sure it has no effect whatsoever?

Cheers,
Tunc

2 Likes