Xamarin forms IOS app size increases from 42.8 MB to 108 MB after certification

My app size increases from 42.8 MB to 108 MB after certification, according to IOS documentation

> When your app is approved for the App Store, it is encrypted with DRM and recompressed. The encryption and DRM will increase the file size. The exact size of the increase varies, but can be significant if the binary contains a large proportion of contiguous zeros. The final size for your app after the encryption has been added cannot be determined or guaranteed in advance.

What does it mean by

can be significant if the binary contains a large proportion of contiguous zeros

I wanted to set Link behavior to "Link all assemblies" but my app crashes if I set that. First version my app worked well with "link all assemblies" and after certification it went to 76 MB from 38 MB after certification.

I wanted to get the same size, but unable to please help me.

Best Answer

Answers

  • EmanueleSabettaEmanueleSabetta ITBeta ✭✭✭

    The Xamarin linker is really a joke. It doesn't have the most basic capabilities of predicting the used members and classes. It misses all references beyond the most basics, and it doesn't have any heuristic to go beyond that. You cannot really use "Link all assemblies", unless you manually set the [Preserve] attribute either at the class-level or the member-level for all classes, and even then if you use packages or libraries you cannot preserve anything of those.
    Xamarin should write a decent linker, because we are shipping apps that are usually 3 to 4 times bigger in size than they should be.

  • @EmanueleSabetta so there's no solutioin for this ? I need to keep 102 MB in the store :( ?

  • EmanueleSabettaEmanueleSabetta ITBeta ✭✭✭

    You can do 3 things:

    • 1) You can try some hacks, like custom attributes:
      http://forums.xamarin.com/discussion/comment/133587/#Comment_133587
      But they don't always work.

    • 2) Open an issue on Bugzilla ( https://bugzilla.xamarin.com ). There are many others filed bugs on this already, but add yours to put some pressure on Xamarin to improve the Linker. Be sure to report all crash logs you get when using "Link All Assemblies" in release mode on you physical device.

    • 3) If you are a paying customer, you can send your source code to the support email and ask them to help you with that. Sometimes they suggest to you some code modifications that avoid the crashes when "Link All Assemblies" in Release mode is used on the physical device.
  • MichaelRumplerMichaelRumpler ATMember ✭✭✭✭✭

    I use "SDK assemblies only", but my app is also too big.
    Maybe this can help you: http://kent-boogaart.com/blog/xamarin-linking-wishlist

  • @EmanueleSabetta and @MichaelRumpler do you know what is the meaning of the below statement?

    can be significant if the binary contains a large proportion of contiguous zeros

Sign In or Register to comment.