Vipin Krishna
Vipin Krishna

Reputation: 365

Reduce APK size in Xamarin.Forms, APK size 80MB

Cannot reduce xamarin apk size below 80 MB, did the following:

Visual studio community 2017 version: 15.9.6
Need some help on this...

Upvotes: 4

Views: 1513

Answers (2)

FreakyAli
FreakyAli

Reputation: 16459

Remove all the unwanted assemblies and image resources and it should solve your problem, they can be pesky and painful when it comes to the size of your build.

Also only select the Abi's that are needed for your release build as per me armeabi-v7a and arm64-v8a should be enough.

Also in case, this does not help as SushiHangover suggested unzip the Apk and check what is causing the issue also check the windirstat just like Jon suggested.

Revert in case of queries. Good luck

Upvotes: 1

Nick Kovalsky
Nick Kovalsky

Reputation: 6462

Solution number one would be to use Link user assemblies and SDK. If you totally fail linking your user assemblies then i invite you to do the following:

In project options check 'Generate one package (.apk) per selected ABI'. That will create smaller apks for each processor platform.

Now it is possible that you still fail to publish anything because VS will try to upload the 80mb common apk along with smaller apks for dedicated platforms, resulting in "apk too big" error.

So after you sign apks for publishing open the distribution folder, then the 'signed-apks' subfolder. Inside you will see apks built for different platforms, the picture will be similar to this:

enter image description here

Now open Google developper console and create a release, then upload manually apks one by one except the huge one. You are then good to go.

I guess we are limited to this option until we get a new compiler/linker with VS 2019 or maybe earlier.

Upvotes: 1

Related Questions