Forum Xamarin.Android

Announcement:

The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

AAB Size has Doubled Overnight

MGicMGic Member ✭✭

Before I went away on staycation last week, I did a release build that came out to about 100MB when building the AAB. When I "got back" this morning, my AABs are getting spit out at 250+ MB. No code or configuration changes have been made whatsoever. I've tried updating VS for Mac, restarting my machine, updating Android Studio for Mac, all to no avail. When using MSBUILD in the terminal to build, it's the same story, implying it's an issue with MSBUILD. Can anybody help?

Best Answer

  • MGicMGic Member ✭✭
    Accepted Answer

    Solution found: Disabled and reenabled AOT Profiling (aka Startup Tracing) directly in the Android.csproj file. Seems the checkbox in the project properties UI is busted on my machine.

Answers

  • YelinzhYelinzh Member, Xamarin Team Xamurai

    Does the project contains more resources, like audios or other files in assets? Are there also a lot of third-party libraries referenced in the application? Try to use ProGuard to optimize the project.

    You could refer to the tutorial to shrink the app size.
    https://devblogs.microsoft.com/xamarin/shrinking-android-app-size/

  • MGicMGic Member ✭✭

    ProGuard is replaced by r8, have already done a good bit of optimization. The only thing that has changed is time. Even going back to earlier commits that yielded much smaller builds are seeing AABs that are 200-300% larger than before.

  • MGicMGic Member ✭✭
    Accepted Answer

    Solution found: Disabled and reenabled AOT Profiling (aka Startup Tracing) directly in the Android.csproj file. Seems the checkbox in the project properties UI is busted on my machine.

Sign In or Register to comment.