Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have been working on an Android app but size seems very large! I have pro guard enabled, link all enabled but dosent seem to do much. I have four small images but their size is around 5-10kb each. The only time it is smaller is when I run with shared runtime but that's not Ok for publishing. These are my only build warnings:

Warning     can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [classes.jar:META-INF/MANIFEST.MF])    

Warning     can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [internal_impl-22.2.1.jar:META-INF/MANIFEST.MF])

Do these warnings have anything to do with issue?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
341 views
Welcome To Ask or Share your Answers For Others

1 Answer

The apk is about 14MB, including armeabi, amreabi-v7a, x86. Link setting is: 'Sdk and User Assemblies'

Nothing seems amiss with that apk size.

A "Hello World" Xamarin.Android app supporting just one ARCH type that is linking SDK and User assemblies would be around 4MB (for ARCH type armeabi-v7a).

Each additional included ARCH type is going to add another set of libmonodroid.so and libmonosgen-2.0.so... Remember Mono running on Android is an NDK application and thus must include native code for each ARCH type. The APK size is NOT the size of the actual installed application on the physical device as the Android OS will strip the actual needed native libraries from the APK during the install.

So in your case of including three arch types, you are looking at 9+MB just for the Mono/MonoDroid runtime:

./armeabi:
   144912  libmonodroid.so
  2835260  libmonosgen-2.0.so

./armeabi-v7a:
   144916  libmonodroid.so
  2790212  libmonosgen-2.0.so

./x86:
   128436  libmonodroid.so
  3449836  libmonosgen-2.0.so

Understanding the Constituent Pieces of APKs in Xamarin.Android


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...