React Native

React Native Android 15 16KB Page Size Fix: Solving ELF Alignment Failed

Hit by "ELF alignment failed" on Android 15?

2026-03-318 minMikołaj Gramowski
Author profile: Mikołaj Gramowski
React Native Android 15 16KB Page Size Fix: Solving ELF Alignment Failed

How I Fixed React Native Android 15 16KB Page Size Errors (Including libcrashlytics UNALIGNED)

Google Play now enforces 16KB memory page compatibility for native libraries on modern Android targets. If your React Native release contains older native binaries, your upload can fail with ELF alignment failed errors — especially around Firebase Crashlytics NDK libraries.

This post walks through the exact issue I solved, the specific errors I hit, and the precise Gradle fixes that produced an Android 15 Play Store compliant release AAB.

The Problem: ELF Alignment Failed in React Native

While prepping a release, my verification script reported native ELF alignment failures:

/lib/arm64-v8a/libcrashlytics.so: UNALIGNED (2**12)
/lib/arm64-v8a/libcrashlytics-common.so: UNALIGNED (2**12)
/lib/arm64-v8a/libcrashlytics-handler.so: UNALIGNED (2**12)
/lib/arm64-v8a/libcrashlytics-trampoline.so: UNALIGNED (2**12)

I also saw this summary line in the build output:

Found 26 unaligned libs (only arm64-v8a/x86_64 libs need to be aligned).

At first glance, that summary can be confusing. The critical requirement is alignment for 64-bit ABIs. For Google Play compliance, fixing arm64-v8a is your absolute top priority.

Why This Happens

The root cause of this Firebase Crashlytics NDK alignment issue boils down to outdated dependency resolution. Even though the React Native app builds successfully, older Crashlytics native components are still being packaged into the final bundle.

  • Your app builds successfully.
  • But packaged native libraries still fail the 16KB alignment checks.
  • The Crashlytics NDK libs are usually the hidden blocker.

Secondary Error: Could not find com.google.firebase:firebase-iid

While trying to upgrade my Firebase and Crashlytics dependencies to fix the alignment issue, my build suddenly failed due to a dependency conflict stemming from react-native-device-info:

Could not resolve all files for configuration ':react-native-device-info:releaseCompileClasspath'.
Could not find com.google.firebase:firebase-iid.

The Fix That Worked

To fix both the libcrashlytics.so UNALIGNED issue and the firebase-iid conflict, I applied three coordinated updates to my Android Gradle configuration:

  1. Upgraded the Firebase BoM to a version that ships 16KB-friendly native artifacts.
  2. Upgraded the Google Services and Crashlytics Gradle plugins to their current, compatible versions.
  3. Added a dependency resolution strategy to force firebase-iid and unblock the transitive conflict.

Dependency and Plugin Versions Used

  • Firebase BoM: 33.6.0
  • Google Services Gradle plugin: 4.4.2
  • Firebase Crashlytics Gradle plugin: 3.0.2
  • Forced dependency: com.google.firebase:firebase-iid:21.1.0

Step-by-Step Gradle Changes

First, update your root android/build.gradle file:

buildscript {
  dependencies {
    classpath('com.google.gms:google-services:4.4.2')
    classpath('com.google.firebase:firebase-crashlytics-gradle:3.0.2')
  }
}

allprojects {
  configurations.all {
    resolutionStrategy {
      // This fixes the 'Could not find com.google.firebase:firebase-iid' error
      force 'com.google.firebase:firebase-iid:21.1.0'
    }
  }
}

Next, update your android/app/build.gradle dependencies:

dependencies {
  implementation platform('com.google.firebase:firebase-bom:33.6.0')
  implementation 'com.google.firebase:firebase-analytics'
}

Build and Verify Flow

After making these version changes, I ran a clean release build to validate the output package.

./gradlew clean
./gradlew assembleRelease
./gradlew bundleRelease

Once the build finishes, run your ELF verification script against the generated .aab or .apk.

Verification Result After the Fix

The final check showed that the critical 64-bit targets were successfully aligned to 16KB (2**14):

/lib/arm64-v8a/libcrashlytics.so: ALIGNED (2**14)
/lib/arm64-v8a/libcrashlytics-common.so: ALIGNED (2**14)
/lib/arm64-v8a/libcrashlytics-handler.so: ALIGNED (2**14)
/lib/arm64-v8a/libcrashlytics-trampoline.so: ALIGNED (2**14)

Key Takeaways for React Native Developers

  • Build success ≠ Compliance: A successful Gradle build does not guarantee 16KB page-size compliance.
  • Check the NDK: Crashlytics NDK artifacts are often the hidden blocker behind alignment failures.
  • Sync your upgrades: Upgrading only one Firebase dependency is rarely enough; plugin and BoM versions must be bumped together.
  • Force resolution when needed: Dependency conflicts like firebase-iid can appear during migration.
  • Always verify: Run a final APK/AAB native alignment check before uploading to the Play Console.

Final Word

If you are getting React Native 16KB page size failures, treat it as a dependency alignment problem, not just a compiler problem. Updating the Firebase BoM, the Crashlytics tooling, and explicitly resolving legacy transitive dependencies fixed the issue for me end-to-end, producing a release-ready, compliant AAB.