From d920ec440d36200591e2f78fb4110f1671ba8931 Mon Sep 17 00:00:00 2001 From: Ryan Brooks Date: Wed, 19 Nov 2025 20:49:43 -0800 Subject: [PATCH] Add docs for multiple native lib architectures insight --- .../android/size-analysis/insights.mdx | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/docs/platforms/android/size-analysis/insights.mdx b/docs/platforms/android/size-analysis/insights.mdx index 8c1bd1b1ffd6d..64da7c804506b 100644 --- a/docs/platforms/android/size-analysis/insights.mdx +++ b/docs/platforms/android/size-analysis/insights.mdx @@ -18,6 +18,7 @@ Below are a list of available insights for Android builds, followed by more deta | [WebP Optimization](#webp-optimization) | Tests PNG/JPEG bitmaps to see if lossless WebP would shrink them. | | [Large Audio](#large-audio) | Surfaces hefty audio tracks that could be recompressed or trimmed. | | [Hermes Debug Info (RN Only)](#hermes-debug-info-rn-only) | Points to bundled Hermes bytecode still carrying debugger metadata. | +| [Multiple Native Library Architectures](#multiple-native-library-architectures) | Detects when multiple native library architectures are packaged in an APK. | ### Duplicate Files @@ -106,3 +107,26 @@ You can tweak the bitrate (`b:a`) to balance quality vs. size. Higher bitrates ( **What it is**: Detects Hermes bytecode bundles that still contain debug info sections. **How to fix**: Build the React Native bundle in release mode (`react-native bundle --dev false` or the Gradle release task) so Hermes strips debug sections before packaging. + +### Multiple Native Library Architectures + +**What it is**: Detects when multiple native libraries are packaged in an APK supporting different architectures. End user devices will only use one architecture (usually arm64_v8a), so most can be removed. + +**How to fix**: Upload an AAB to the Play Store (Google will automatically pass the architecture the end user needs). We also recommend you upload an AAB for size analysis. + +If you ship an APK, the `split {}` block can be used to output split APKs manually. If configured to skip ABI splits, Android will package all native library architectures into the main split. + +Ensure your split Gradle dls config has the `isEnabled = true` field set for the `abi {}` block. + +```kotlin +android { + splits { + .. + + abi { + isEnabled.set(true) + } + } +} +``` +More information about the ABI configuration for manual APK splits can be found in the [Android developer documentation](https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split).