fix(android): exclude x86_64 ABI from production AAB to resolve Play 16 KB warning#30590
Conversation
Google Play flagged base/lib/x86_64/libconceal.so (from react-native-keychain -> com.facebook.conceal:1.1.3) and base/lib/x86_64/libsecp256k1.so (from react-native-fast-crypto) as not compliant with Android's 16 KB page-size requirement. Both ship as prebuilt 4 KB-aligned binaries inside their AARs and cannot be realistically rebuilt: Conceal is unmaintained since 2018, and react-native-fast-crypto consumes libsecp256k1.so as an IMPORTED prebuilt rather than building it from source. x86_64 is only ever used by Chromebook ARC++/ARCVM and emulators; no real phone runs x86_64. Dropping the x86_64 ABI from production AABs silences the Play warning without affecting users. Two changes are needed together: 1. android/gradle.properties.release: remove x86_64 from reactNativeArchitectures so React Native's own native libs aren't built for that ABI. 2. android/app/build.gradle: add ndk.abiFilters mirroring the reactNativeArchitectures list. Without this, AGP packages every ABI shipped in dependency AARs regardless of reactNativeArchitectures, which is what put x86_64 libconceal.so and libsecp256k1.so into the AAB in the first place. Local dev (android/gradle.properties), CI E2E (android/gradle.properties.github) and dual-version builds are unchanged - x86_64 emulator workflows continue to work because the abiFilters list is derived dynamically from reactNativeArchitectures. Follow-up work tracked separately: the same .so files still ship for arm64-v8a with 4 KB alignment. Structural fixes (replace react-native-fast-crypto with quick-crypto scrypt, drop the Conceal dependency in react-native-keychain since minSdk=24 means it is dead code) will close that gap. Co-authored-by: Cursor <cursoragent@cursor.com>
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
These changes:
No E2E tests need to run for these changes, and no performance tests are warranted. Performance Test Selection: |
|
Follow-up tracking issues for the structural arm64-v8a fixes called out in this PR:
Once both land, the same |
|



Description
Google Play flagged two prebuilt
.sofiles in our production AAB as non-compliant with Android's 16 KB page-size requirement, both in thex86_64ABI:base/lib/x86_64/libconceal.so— fromreact-native-keychainviacom.facebook.conceal:1.1.3(last released in 2016, archived upstream).base/lib/x86_64/libsecp256k1.so— fromreact-native-fast-crypto, shipped as anIMPORTEDprebuilt in its CMake config (not rebuilt from source).Neither library can be realistically rebuilt with 16 KB alignment:
react-native-fast-cryptoconsumeslibsecp256k1.soas a prebuilt binary; the existing yarn patch already adds-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ONfor the bridge code we compile, but it does not regenerate the importedlibsecp256k1.sofiles.x86_64 is only ever used by Chromebook ARC++/ARCVM and emulators — no real phone ships with an x86_64 CPU. Dropping the x86_64 ABI from production AABs silences the Play warning without affecting users.
What this PR does
Two changes that need to land together:
android/gradle.properties.release— removex86_64fromreactNativeArchitecturesso React Native's own native libs (Hermes, RN core) aren't built for that ABI in the production AAB.android/app/build.gradle— addndk.abiFilters(*reactNativeArchitectures())insidedefaultConfig. Without this, AGP packages every ABI shipped in dependency AARs regardless ofreactNativeArchitectures, which is what put the x86_64libconceal.soandlibsecp256k1.sointo the AAB in the first place.A small refactor of the
reactNativeArchitectures()helper to return aList(via.toList()) makes the Groovy spread*reactNativeArchitectures()intoabiFilters(String...)robust across AGP/Groovy versions.What this PR does NOT change
android/gradle.properties(default) — local dev still gets x86_64 emulator support.android/gradle.properties.github(CI E2E,x86_64only) — the newabiFiltersresolves to["x86_64"]in that context, so emulator tests continue to work.android/gradle.properties.github.dual-versions(armeabi-v7a,arm64-v8a) — already excludes x86_64.scripts/build.sh-PreactNativeArchitectures=...CLI overrides — still respected by the helper.Follow-up work (out of scope)
The same
.sofiles still ship forarm64-v8awith 4 KB alignment. If/when Play extends the warning to arm64, or enforces the runtime 16 KB device requirement more aggressively on Android 15+ devices in 16 KB mode, these will need structural fixes:react-native-fast-cryptowithreact-native-quick-crypto@1.x(we only consumescrypt).react-native-keychain(yarn patch or upgrade to v10) — safe becauseminSdk = 24means the Conceal cipher path is never selected at runtime.Changelog
CHANGELOG entry: null
Related issues
Fixes: Google Play 16 KB page-size warning for
base/lib/x86_64/libconceal.soandbase/lib/x86_64/libsecp256k1.so.Manual testing steps
Screenshots/Recordings
Before
Play Console flagged:
base/lib/x86_64/libconceal.sobase/lib/x86_64/libsecp256k1.soAfter
Production AAB contains no
lib/x86_64/directory — both warnings cleared.Pre-merge author checklist
unzip -lcheck on the produced AAB)team-mobile-platformPerformance checks (if applicable)
gradle.properties.github(x86_64-only) path used by CI E2E.Pre-merge reviewer checklist
Made with Cursor
Note
Low Risk
Build-time ABI and packaging configuration only; no runtime app logic, auth, or data-path changes, with emulator/CI paths still driven by their gradle overlays.
Overview
Production Play Store builds stop shipping x86_64 native libraries so Google Play’s 16 KB page-size warnings go away for prebuilt
libconceal.soandlibsecp256k1.sothat only appeared underlib/x86_64/.android/gradle.properties.releasedropsx86_64fromreactNativeArchitectures(nowarmeabi-v7a,arm64-v8a,x86).android/app/build.gradleaddsdefaultConfig.ndk.abiFilters(*reactNativeArchitectures())so AGP does not still package every ABI from third-party AARs when RN’s arch list is narrower. ThereactNativeArchitectures()helper now returns a GroovyListvia.toList()so the spread intoabiFiltersis reliable.Default and CI gradle property files are unchanged in this diff: local debug can still target x86_64 emulators, and CI E2E overlays that still set
x86_64only continue to filter to that ABI.Reviewed by Cursor Bugbot for commit 40dd023. Bugbot is set up for automated code reviews on this repo. Configure here.