question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to reduce Android apk size? (build by React Native) What's the minimum Android APK size?

See original GitHub issue

Is 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:closed
  • Created 6 years ago
  • Reactions:9
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
thevolcanomanisherecommented, Jan 16, 2018

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

2reactions
thevolcanomanisherecommented, Jan 16, 2018

Use the apk analyser in Android studio and see what is taking up the space then post the screenshot back here

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to reduce Android APK size in react-native?
Open up android/app/build.gradle · Set def enableProguardInReleaseBuilds = true this would enable Progaurd to compress the Java Bytecode. This ...
Read more >
How to Reduce React Native App Size? - Aglowid IT Solutions
Ways to Reduce the App Size of React Native · Android App Bundle File (.aab file) · Enable Resource Shrinking · Enable Proguard...
Read more >
How I Reduced the Size of My React Native App by 86%
This split reduced the apk size from around 7MB to 3.5MB for arm and 5MB for x86 respectively. Yeahhh. So that's how you...
Read more >
How we reduced our production apk size by 70% in React ...
You are right the initial react native app's universal apk will always be around 23-27mb. If you can see above hello world, example...
Read more >
How to Reduce React Native APK Size - LinkedIn
Open up android/app/build.gradle · Set def enableProguardInReleaseBuilds = true this would enable Progaurd to compress the Java Bytecode. This ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found