1

When I built universal apk it size was 170mb. After I implemented extension files (due to the large asset folder) I have to build bundles. But the bundle size is much bigger - 283mb. Uppon unzipping aab file I see, that just lib folder weights 150mb. And includes extra architectures which are not present in config (like mips)

  splits {
    abi {
      enable true
      reset()
      include 'x86', 'armeabi-v7a', 'arm64-v8a'
      universalApk false
    }
  }

Thre is split of folder sizes, where libraries ar emostly c++ libs.

enter image description here What can be done to mitigate such increase as playmarket only accept bundle with 150mb and lower (not including asset-delivery size)

Yarh
  • 4,459
  • 5
  • 45
  • 95

2 Answers2

0

Code analysis can help find unnecessary code. Analyze -> Inspect Code... -> Whole project. That can clean up some space. If you have dependencies that are large, you can replace them with smaller dependencies, but you will need to rewrite code.

You can ask gradle to reduce the size of dependencies:

android {
    // Other settings

    buildTypes {
        release {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

Here is a link about reducing apk size: reduce-apk-size

and another: shrink code

Most of it is added with the code above.

John Glen
  • 771
  • 7
  • 24
  • thats a problem, there are 2 mentioned dependencies which are large and I cannot get rid of them as app logic heavily relies on them – Yarh Oct 27 '20 at 15:09
  • Did you try ```minifyEnabled true``` and ```shrinkResources true```? – John Glen Oct 27 '20 at 20:50
0

App Bundle size is not a direct indication of how big it will be the download for the users. Also the 150MB limit is the compressed download size limit.

You should upload your App Bundle and use Play Console's App Bundle Explorer to double check the size of the downloads.
Google Play Store implements many optimizations to reduce downloads when it delivers application from and Android App Bundle.

You can find more information in the documentation: https://d.android.com/appbundle

pfmaggi
  • 6,116
  • 22
  • 43