Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We've updated our Terms of Service. Please read our blog post from Unity CTO and Co-Founder Joachim Ante here
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

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

Discussion in 'Unity Cloud Build' started by Avinash-pdy, Feb 23, 2016.

  1. Avinash-pdy

    Avinash-pdy

    Joined:
    Mar 4, 2013
    Posts:
    19
    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
     
    lior_rosenspitz likes this.
  2. David-Berger

    David-Berger

    Unity Technologies

    Joined:
    Jul 16, 2014
    Posts:
    646
    Thanks for the post, as said we currently work on the problem, we will keep you updated on this issue in this thread! :cool:
     
    lior_rosenspitz likes this.
  3. lior_rosenspitz

    lior_rosenspitz

    Joined:
    Jan 24, 2015
    Posts:
    24
    Also noticed the same problem with my projects as well.
    Now I know it's a bug before I even started investigating...
     
  4. Avinash-pdy

    Avinash-pdy

    Joined:
    Mar 4, 2013
    Posts:
    19
    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
     
  5. David-Berger

    David-Berger

    Unity Technologies

    Joined:
    Jul 16, 2014
    Posts:
    646
    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.
     
  6. SecretPotion

    SecretPotion

    Joined:
    Jan 12, 2015
    Posts:
    7
    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.
     
  7. Ryanc_unity

    Ryanc_unity

    Unity Technologies

    Joined:
    Jul 22, 2015
    Posts:
    163
    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: http://forum.unity3d.com/threads/unity-5-3-x-build-size-increase-faq.383533/

    Screen Shot 2016-03-04 at 10.44.17 AM.png
     
  8. Avinash-pdy

    Avinash-pdy

    Joined:
    Mar 4, 2013
    Posts:
    19
    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.
     
  9. Ryanc_unity

    Ryanc_unity

    Unity Technologies

    Joined:
    Jul 22, 2015
    Posts:
    163
    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.)
     
  10. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    756
    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 :)

    Best,
    Alex