App RN baseline ~25–40MB (iOS) / ~15–25MB (Android). Tối ưu xuống 10–20MB cho banking app, app SEA emerging market.
Android:
1. Hermes (default 0.70+): bytecode + smaller runtime → giảm 5–10MB so với JSC.
2. R8/ProGuard (default release): obfuscate + tree-shake unused Java code. Thêm rules tránh strip code dùng qua reflection:
-keep class com.facebook.react.** { *; }
-keep class com.swmansion.reanimated.** { *; }3. ABI splits (android/app/build.gradle):
splits {
abi {
enable true
reset()
include 'arm64-v8a', 'armeabi-v7a' // skip x86
universalApk false
}
}Mỗi APK chỉ chứa native lib cho 1 ABI → giảm 30–50% size. Play Store chấp nhận multi-APK.
4. App Bundle (.aab) (recommend): Google chia chunk theo device → user download chỉ phần cần. Giảm 20–30% so với universal APK.
5. Resource shrinking: shrinkResources true trong release. Bỏ asset không reference.
iOS:
1. Bitcode (deprecated từ Xcode 14): không cần config nữa.
2. App Thinning: App Store tự thinning per-device — chỉ download asset cho device đó. Active by default.
3. Strip debug symbols: Strip Linked Product = YES trong release build settings.
Cross-platform:
- Image: dùng WebP/AVIF thay PNG/JPEG. Tool:
expo-imagetự pick format. - Font subset: chỉ ship glyph cần. Tool
glyphhangerhoặc Google Webfonts subset API. - Lottie/JSON animation: minify, dedupe asset chung.
- Audit:
npx react-native-bundle-visualizerxem JS bundle.apkanalyzer(Android Studio) cho APK.
Target số 2026: một app feature trung bình nên fit trong 25MB Android, 40MB iOS install size.
A baseline RN app is ~25–40 MB (iOS) / ~15–25 MB (Android). Banking apps and SEA-emerging-market apps push down to 10–20 MB.
Android:
1. Hermes (default 0.70+): bytecode + smaller runtime → 5–10 MB savings vs JSC.
2. R8/ProGuard (default in release): obfuscate + tree-shake unused Java. Add rules to keep code referenced via reflection:
-keep class com.facebook.react.** { *; }
-keep class com.swmansion.reanimated.** { *; }3. ABI splits (android/app/build.gradle):
splits {
abi {
enable true
reset()
include 'arm64-v8a', 'armeabi-v7a' // skip x86
universalApk false
}
}Each APK contains native libraries for one ABI only → 30–50% size cut. Play Store accepts multi-APK.
4. App Bundle (.aab) (recommended): Google splits chunks per device → users download only what they need. 20–30% smaller than a universal APK.
5. Resource shrinking: shrinkResources true in release. Drops unreferenced assets.
iOS:
1. Bitcode (deprecated since Xcode 14): no longer configurable.
2. App Thinning: the App Store thins per device automatically — users download only their slice. Active by default.
3. Strip debug symbols: set Strip Linked Product = YES in release build settings.
Cross-platform:
- Images: use WebP/AVIF instead of PNG/JPEG. Tool: expo-image picks formats automatically.
- Font subset: ship only the glyphs you need. Tools: glyphhanger or Google Webfonts subset API.
- Lottie/JSON animations: minify, dedupe shared assets.
- Audit: npx react-native-bundle-visualizer for the JS bundle, apkanalyzer (Android Studio) for the APK.
2026 target: a typical-feature app should fit within 25 MB on Android and 40 MB install size on iOS.