3

I have a very simple react native app it doesn't use any heavy resources, just 2 images (146kb combined). Upon generating the .aab file using this https://reactnative.dev/docs/signed-apk-android the size of the .aab file is 27 Mb. Once I publish the release on the playstore and test it on my device there is no change in the size of the app it is still 27 Mb. I have tried the following in an effort to reduce the size of the app but to no avail.

How to reduce Android APK size in react-native?

How to decrease React-Native android App Size

https://medium.com/@aswinmohanme/how-i-reduced-the-size-of-my-react-native-app-by-86-27be72bba640

The below code is what I'm currently using as part of the build.gradle file. I'm not sure on where I'm going wrong or why the size of the .aab file is 27 Mb even after installing on my device (I understand the .aab files are bundled with multiple apk configs and the size is supposed to reduce anywhere between 7-10 Mb on installation).

Any help would be greatly appreciated thanks in advance!

def enableSeparateBuildPerCPUArchitecture = true
def enableProguardInReleaseBuilds = true

splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk false  // If true, also generate a universal APK
            include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
        }
    }
buildTypes {
        debug {
            signingConfig signingConfigs.debug
        }
        release {
            // Caution! In production, you need to generate your own keystore file.
            // see https://reactnative.dev/docs/signed-apk-android.
            debuggable false
            shrinkResources true
            zipAlignEnabled true
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
            signingConfig signingConfigs.release
        }
    }
blaziken105
  • 501
  • 3
  • 10
  • 25

1 Answers1

-2

It works only after you upload it on the app store so the .aab file on local installs is generally heavier from those that are directly donwloaded from the play store.

blaziken105
  • 501
  • 3
  • 10
  • 25