3

My android release apk size built using Flutter is around 150MB. I would like to upload this apk to the google play store but play store has a apk size limit of 100MB. In Android app development we create APK expansion files for such limit in steps shown in this link. Would like to know the steps in Flutter code to create and use similar expansion files and reduce the app size to below 100MB.

Update This question is not related to large size of apk due to Flutter. The apk is huge because of the assets used in the app. Want to know the process of uploading such apps in Flutter. In native android development we have the option of expansion files as shown in the link. IS there a similar option for Flutter if not what is the process to upload such apps to google play store.

Abu Saad Papa
  • 1,908
  • 15
  • 20
  • Most likely your assets – Rémi Rousselet Oct 07 '18 at 01:25
  • 3
    I am not complaining about the large apk size, I know it is due to my assets want to know the process of uploading an app with such big assets. In native Android development we have the option of expansion files. Do we have such an option in Flutter if not what is the process to upload huge size apk? – Abu Saad Papa Oct 07 '18 at 04:07
  • do you found any solution in flutter ?! – Mohammad Seyedmahmudi Mar 13 '20 at 20:42
  • I actually reduced my apk size. You can try the solution given [here](https://stackoverflow.com/questions/56467058/how-to-create-apk-expansion-files-for-assets-within-flutter?answertab=active#tab-top) – Abu Saad Papa Mar 16 '20 at 06:58

5 Answers5

1

When building a release version of your app, consider using the --split-debug-info tag. This tag can dramatically reduce code size. For an example of using this tag, see Obfuscating Dart code.

Some of the other things you can do to make your app smaller are:

Remove unused resources
Minimize resource imported from libraries
Support a limited number of screen densities
Compress PNG and JPEG files

or

One way that i use to reduce my app size is to use;

flutter clean

before i run the build command;

flutter build appbundle --target-platform android-arm,android-arm64
Rudresh Narwal
  • 2,740
  • 3
  • 11
  • 21
0

Use an appbundle and you get 150mb https://developer.android.com/guide/app-bundle

use Firebase Storage to download the content (12 cents per gig) https://firebase.google.com/pricing

or follow the Expansion files inclusion in Flutter (it is very quiet at the moment) https://github.com/flutter/website/issues/2215

atreeon
  • 21,799
  • 13
  • 85
  • 104
0

use this command to create multiple small size apk then upload multiple apk in play store

flutter build apk --split-per-abi
0

Use Deferred components for app-bundle generation if you have larger apk in flutter.

This feature is currently only available on Android, taking advantage of Android and Google Play Stores’ dynamic feature modules to deliver the deferred components packaged as Android modules. Deferred code does not impact other platforms, which continue to build as normal with all deferred components and assets included at initial install time

M.ArslanKhan
  • 3,640
  • 8
  • 34
  • 56
-1

I agree with @RémiRousselet maybe you can check your assets and tell us if that's the case. But if it's not, then maybe it's a package issue.

But as an FYI, Flutter team has an answer for big size APK. Check this. Also check this to know the minimum size of Flutter that they came up with. It was stated that,

we measured the size of a minimal Flutter app (no Material Components, just a single Center widget, built with flutter build apk), bundled and compressed as a release APK, to be approximately 4.48MB.

Judging from that statement, the Flutter APK is really large and it has a fixed overhead size.

Here are some reference you can check regarding how to reduce APK size.

Also check this StackOverflow question related to yours.

arvicxyz
  • 381
  • 3
  • 13