I know this question asked before but the solutions provided there is not enough to reduce app size.
I have create a app using react-native init
. No any third party library added yet. Just a hello world app. but its release build size is 48mb.
After that I used def enableProguardInReleaseBuilds = true
it reduced 2Mb and app size become 46MB.
Again I used def enableSeparateBuildPerCPUArchitecture = true
app size reduced to half now its 26MB.
But why just a hello world app in react-native takes 26MB. Its seems quite useless.
Here is my package.json file
{
"name": "WooVendors",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "16.8.3",
"react-native": "0.59.5"
},
"devDependencies": {
"@babel/core": "^7.4.4",
"@babel/runtime": "^7.4.4",
"babel-jest": "^24.8.0",
"jest": "^24.8.0",
"metro-react-native-babel-preset": "^0.54.0",
"react-test-renderer": "16.8.3"
},
"jest": {
"preset": "react-native"
}
}
Using Android App Bundle(aab) will slightly reduce apk size (>=8Mb).
To generate Android App Bundle follow Official Guide Here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With