New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I compare 0.72.5 and 0.74.0 react native android app size,0.74.0 is 50MB,And 0.72.5 is 21.7 MB.How to reduce 0.74.0 android app size? #44291
Comments
|
I found this really is a amazing thing, so Why lead to this question. |
@Hao-yiwen What was the reason why other had significant difference? |
@Hao-yiwen did you figure it out? really interested in this one. Maybe it has something to do with ProGuard config? |
Same problem, apk size changed from 53.6M to 114.7M. |
Same here. After upgrading to 0.74, the apk size has approximately doubled. |
@Abhisflyingsoon Demo is pure reactNative project,don't do other thing. |
Work for me. |
AndroidManifest.xml <application |
I did some tests with the universal APK (containing all architectures) and splitting the APKs by architecture. The APK generated by
However, once the app is installed on the device, the single-architecture APK exhibits a reduction in app size:
If the app is distributed through an app store like Google Play, the store may generate an "optimized APK" for the users. Using the App Analyzer tool bundled with Android Studio, the estimated "Download Size" of the APKs is basically the same:
So users from an app store may not notice changes in the download or installed size of the app. But the increase in the size of the APK could be noticeable for some developers and users who download the APKs directly. |
any solution. |
that's worked |
Hey all, @jonasbantunes shared the correct answer here.
Specifically in 0.74, we reduced the App size on device by ~13% due to minSDK bump and removal of several unnecessary dynamic libraries (see https://reactnative.dev/blog/2024/04/22/release-0.74#bonus-android-app-size-reduction). That's the metric that @jonasbantunes mentioned here:
Also
Users from App Stores will benefit from a reduction on App size on device. The increase in APK size could be noticeable if you download the APK manually and distribute it to your users/developers that way (i.e. for test users or so). The reason why you're seeing an APK size increase on disk, it's because the dex files are uncompressed starting from AGP 8.2 + with the minSdk bump to 23, the native libs are also shipped uncompressed on the APK. Regardless of compression inside the APK, when the APK is distributed through the wire it's compressed all together (so the 30Mb you see on disk are irrelevant for the users).
This is also not recommended as it will make your app slower. |
Description
I compare 0.72.5 and 0.74.0 react native android app size,0.74.0 is 50MB,And 0.72.5 is 21.7 MB.
Steps to reproduce
0.72.5
0.74.0
Two react-native android app all use
npx react-native init xxx
,and direct use./gradlew assembleRelease
in android fold.React Native Version
0.74.0
Affected Platforms
Runtime - Android
Output of
npx react-native info
0.74.0
Reproducer
no url.
Screenshots and Videos
No response
The text was updated successfully, but these errors were encountered: