Forum Xamarin.Android

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

AnonymousUserAnonymousUser USMember ✭✭✭

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 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.

Best Answer

Answers

  • ColeXColeX Member, Xamarin Team Xamurai
    edited May 2020

    Did you update visual studio during the 3 months ?

    Maybe the project enables some options for Shrinking application by default while visual studio get update , refer https://devblogs.microsoft.com/xamarin/shrinking-android-app-size/ .

    BTW , can you succeed in running the new creation(after renew key store) ?

  • AnonymousUserAnonymousUser USMember ✭✭✭

    Did you update visual studio during the 3 months ?

    I haven't updated Visual Studio in the last 3 months.

    Maybe the project enables some options for Shrinking application by default while visual studio get update , refer https://devblogs.microsoft.com/xamarin/shrinking-android-app-size/ .

    For the generation of the second apk I have followed the same steps I followed for the generation of the first apk. The steps from the following link:

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

    I don't want any shrinking of the apk size. If the project enables that, how can I disable it?

    BTW , can you succeed in running the new creation(after renew key store) ?

    I installed the apk succesfully, but when I tried to run the app I got: Unfortunatelly the app has stopped error message.

  • AnonymousUserAnonymousUser USMember ✭✭✭

    I don't have Code shrinker option, maybe because my Visual Studio is older. But when changing Linking to None , that solved the problem.

Sign In or Register to comment.