How to reduce Android apk size? (build by React Native) What's the minimum Android APK size?
See original GitHub issueIs this a bug report?
NO
Have you read the Contributing Guidelines?
No
Environment
Environment: OS: macOS High Sierra 10.13.2 Node: 8.9.4 Yarn: 1.3.2 npm: 5.6.0 Watchman: 4.9.0 Xcode: Xcode 9.2 Build version 9C40b Android Studio: 3.0 AI-171.4443003
Packages: (wanted => installed) react: 16.0.0 => 16.0.0 react-native: 0.51.0 => 0.51.0
Background info
I build a simple App that focus on Android for now, the generate APK size is about 8~9 mb (6 screen, 4 image that add up doesn’t exceed 500kb, just logo and splash screen)
My question is
What’s the minimum size a React Native Android APK can get?
there not much info on Google, here is few of them:
https://github.com/facebook/react-native/issues/5037 https://hashnode.com/post/how-to-reduce-the-app-size-in-react-native-cj6ohocv002rqt9wuy24etkee https://facebook.github.io/react-native/docs/signed-apk-android.html https://stackoverflow.com/questions/38184734/react-native-for-small-size-apk-with-low-internet-bandwidth
seem like
def enableProguardInReleaseBuilds = true
def enableSeparateBuildPerCPUArchitecture = true
is the most I can do,
it’s 2018 and newest React Native version is 0.52,
is there anything more I can do to reduce Android APK size?
the ideal size should be around 1~3mb
Thank you very much 😃
Issue Analytics
- State:
- Created 6 years ago
- Reactions:9
- Comments:11 (2 by maintainers)
Top GitHub Comments
You could reduce the size of your launcher images by a good bit. Look up how to compress your images efficiently. You are also creating an api with both x86 and arm versions. x86 alone is 3.1mb. Without that and more efficient images you could reduce your apk by 4-5megs
Use the apk analyser in Android studio and see what is taking up the space then post the screenshot back here