Forum Xamarin.Android

Huge APK size.. is it normal?

IvanToledoIvanToledo CLUniversity ✭✭

Hi, I just finished my Android app. The VS2012 solution contains a PCL, a WP8 app and the Android app. The PCL is added as a reference to the Android project. Xamarin Android 4.10.01073.

I'm using the following components: Google Analytics, Google Play Services (Gingerbread), Reactive Extensions (Rx) for Xamarin. In the app i'm using Google Maps & Admob from Play Services.

The APK is huge (16,2MB), I noticed that the biggest assemblies are mscorlib (1,5mb), Xamarin.Android.Support.v4 (1,4mb), Mono.CSharp (1,2mb) and GooglePlayServicesLib (1mb).

Also the generated APK is not compressed, is this normal? APKs generated with ADT are compressed.

Any hints to reduce apk size?

Posts

  • TomOpgenorthTomOpgenorth CAXamarin Team Xamurai
    edited January 2014

    Is this a debug build? They tend to be much bigger. Release builds will be a bit smaller as Xamarin.Android will remove unused code. See Application Package Size and Linking.

  • IvanToledoIvanToledo CLUniversity ✭✭

    It's a release build. I'm already linking SDK assemblies (when linking user assemblies I get a crash), I think that the easiest thing to do would be to remove x86 & armeabi-v7a... that should save a few megabytes, but it's still too large.

  • TomOpgenorthTomOpgenorth CAXamarin Team Xamurai

    That will save about 3.8MB per architecture.

    I'd remove x86 and armeabi while keeping armeabi-v7a. Most modern Android devices are armeabi-v7a anyway.

  • mliumliu USMember ✭✭

    I managed to reduce my xamarin apk size down to ~10 megs by only targeting armeabi-v7a and using 'Link SDK assemblies only'. Are there any other tricks to reduce apk size? The same apk created using android studio runs 1-2 megs.

  • FZelleFZelle DEMember ✭✭✭

    No, and that is understandable.

    The release version consists of the whole (cleaned up by linker) Mono runtime.

  • SebastianSeidel.9226SebastianSeidel.9226 DEInsider, University ✭✭✭✭

    Check your resources. Shrinking images can also be a option.

Sign In or Register to comment.