Search code examples
visual-studioxamarin.androidapksize

Second generated apk is smaller than the first one(Xamarin.Android, Visual Studio)


3 months ago I generated an apk file of Xamarin.Android project following the steps of the following link:

https://riptutorial.com/xamarin-android/example/29653/preparing-your-apk-in-the-visual-studio

The apk size was 65 MB. I copied the apk on my phone, installed the app, the app ran and everything was fine. I continued to work on the project for the next 3 months, then I tried to generate an apk following the steps from the same link, I succeded but the size of the generated apk was 10 MB which is not normal because during these 3 months I've been adding code and files to the project, the second apk must have been bigger than the first one (bigger than 65 MB). When I copied the second apk on the phone and installed the app, when I executed it, I got Unfortunatelly the app has stopped error message. During the first apk creation I created an Android Key Store but before the second apk creation I deleted it by mistake so I had to create new one. I don't know if that has anything to do with the problem.


Solution

  • In Android Options I put Linking to None and that solved the problem.