2

Issue: Android app crashes on launch with dlopen failed: library "libreact_featureflagsjni.so" not found after migrating for 16 KB page size with React Native 0.77.0

Context

I am upgrading my React Native app from version 0.72.8 to 0.77.0 and trying to make the native .so libraries compatible with the Android 16 KB page size. The build is successful, but the app crashes immediately on launch with the following error:

Process: com.example.app, PID: 8267 java.lang.UnsatisfiedLinkError: dlopen failed: library "libreact_featureflagsjni.so" not found

Environment

  • React Native version: 0.77.0

  • Gradle version: 8.10 (distributionUrl: https://services.gradle.org/distributions/gradle-8.10-all.zip)

  • NDK version: 28.2.13676358

  • compileSdkVersion and targetSdkVersion: 35 (Android 14 / API 35)

  • newArchEnabled=false in gradle.properties (build fails otherwise due to Onfido SDK issue)

  • ABI filters: armeabi-v7a, arm64-v8a, x86, x86_64

  • Prefab enabled for native dependencies

  • Hermes enabled conditionally

  • Various libraries upgraded to match RN 0.77.0 compatibility

package.json

//PACKAGE.JSON
"dependencies": {
 "@aws-sdk/client-secrets-manager": "^3.491.0",
 "@expo/vector-icons": "^14.1.0",
 "@invertase/react-native-apple-authentication": "2.2.2",
 "@onfido/react-native-sdk": "^15.2.0",
 "@react-native-async-storage/async-storage": "1.15.5",
 "@react-native-camera-roll/camera-roll": "^7.10.0",
 "@react-native-clipboard/clipboard": "^1.11.2",
 "@react-native-community/checkbox": "^0.5.16",
 "@react-native-community/cli": "18.0.0",
 "@react-native-community/cli-platform-android": "18.0.0",
 "@react-native-community/cli-platform-ios": "18.0.0",
 "@react-native-community/datetimepicker": "^8.4.1",
 "@react-native-community/masked-view": "0.1.11",
 "@react-native-community/netinfo": "9.3.10",
 "@react-native-documents/picker": "^10.1.7",
 "@react-native-firebase/app": "23.0.0",
 "@react-native-firebase/crashlytics": "23.0.0",
 "@react-native-firebase/messaging": "23.0.0",
 "@react-native-picker/picker": "2.4.10",
 "@react-native/assets-registry": "^0.76.3",
 "@react-native/js-polyfills": "^0.76.3",
 "@react-navigation/bottom-tabs": "6.5.7",
 "@react-navigation/drawer": "6.6.2",
 "@react-navigation/native": "6.1.6",
 "@react-navigation/stack": "6.3.16",
 "@reduxjs/toolkit": "^1.9.5",
 "@rneui/base": "^4.0.0-rc.8",
 "@rneui/themed": "^4.0.0-rc.8",
 "@sentry/react-native": "^6.17.0",
 "@types/react-native-version-check": "^3.4.8",
 "aws-sdk": "^2.1538.0",
 "expo": "^53.0.20",
 "expo-asset": "^11.1.7",
 "expo-build-properties": "^0.12.5",
 "expo-updates": "~0.25.25",
 "husky": "^8.0.3",
 "lodash.debounce": "^4.0.8",
 "lodash.get": "^4.4.2",
 "lottie-ios": "3.4.0",
 "lottie-react-native": "^5.1.6",
 "metro": "^0.81.0",
 "metro-react-native-babel-transformer": "^0.77.0",
 "mixpanel-react-native": "^2.3.1",
 "moment": "2.29.1",
 "moment-timezone": "^0.5.45",
 "react": "18.2.0",
 "react-native": "0.77.0",
 "react-native-app-intro-slider": "4.0.4",
 "react-native-biometrics": "^3.0.1",
 "react-native-blob-util": "^0.22.2",
 "react-native-code-push": "^9.0.0",
 "react-native-config": "^1.5.0",
 "react-native-contacts": "7.0.5",
 "react-native-device-info": "10.6.0",
 "react-native-element-dropdown": "^2.9.0",
 "react-native-elements": "3.4.2",
 "react-native-error-boundary": "^1.2.3",
 "react-native-fast-image": "^8.6.3",
 "react-native-fbsdk-next": "^12.1.3",
 "react-native-flash-message": "0.4.1",
 "react-native-fs": "^2.20.0",
 "react-native-gesture-handler": "^2.24.0",
 "react-native-get-random-values": "^1.10.0",
 "react-native-google-places-autocomplete": "^2.5.6",
 "react-native-google-recaptcha-v2": "^1.1.0",
 "react-native-gradle-plugin": "^0.71.19",
 "react-native-html-to-pdf": "^0.12.0",
 "react-native-hyperlink": "0.0.22",
 "react-native-image-crop-picker": "0.41.2",
 "react-native-keyboard-aware-scroll-view": "0.9.5",
 "react-native-linear-gradient": "2.6.2",
 "react-native-localize": "3.0.0",
 "react-native-lottie-splash-screen": "1.1.1",
 "react-native-mmkv": "^2.12.2",
 "react-native-modal": "13.0.1",
 "react-native-modal-datetime-picker": "15.0.1",
 "react-native-network-info": "^5.2.1",
 "react-native-pdf": "^6.7.7",
 "react-native-plaid-link-sdk": "^12.5.3",
 "react-native-public-ip": "^1.0.2",
 "react-native-qrcode-svg": "^6.3.12",
 "react-native-raw-bottom-sheet": "2.2.0",
 "react-native-render-html": "^6.3.4",
 "react-native-root-toast": "3.4.1",
 "react-native-safe-area-context": "^5.6.1",
 "react-native-screens": "^4.16.0",
 "react-native-share": "^12.0.9",
 "react-native-size-matters": "0.4.0",
 "react-native-snap-carousel": "3.9.1",
 "react-native-stopwatch-timer": "0.0.21",
 "react-native-swiper": "1.6.0",
 "react-native-switch-toggle": "2.2.1",
 "react-native-url-polyfill": "^2.0.0",
 "react-native-vector-icons": "9.2.0",
 "react-native-version-check": "^3.4.7",
 "react-native-video": "5.2.1",
 "react-native-view-shot": "^4.0.3",
 "react-native-vision-camera": "^4.7.2",
 "react-native-walkthrough-tooltip": "^1.6.0",
 "react-native-webview": "^13.16.0",
 "react-native-worklets-core": "^1.6.2",
 "react-redux": "^8.0.5",
 "redux-devtools-extension": "2.13.9",
 "redux-persist": "^6.0.0",
 "web-streams-polyfill": "^3.3.2"
 },
 "devDependencies": {
 "@babel/core": "^7.25.2",
 "@babel/preset-env": "^7.25.3",
 "@babel/runtime": "^7.25.0",
 "@react-native-community/eslint-config": "^3.2.0",
 "@react-native/gradle-plugin": "^0.75.5",
 "@testing-library/jest-native": "^5.4.3",
 "@testing-library/react": "^14.0.0",
 "@testing-library/react-native": "^12.3.0",
 "@tsconfig/react-native": "^2.0.2",
 "@types/jest": "^29.5.13",
 "@types/lodash.debounce": "^4.0.7",
 "@types/lodash.get": "^4.4.7",
 "@types/react": "^19.0.0",
 "@types/react-native-html-to-pdf": "^0.8.3",
 "@types/react-test-renderer": "^19.0.0",
 "@typescript-eslint/eslint-plugin": "^5.59.9",
 "@typescript-eslint/parser": "^5.59.9",
 "babel-jest": "^29.2.1",
 "bplist-creator": "^0.1.1",
 "bplist-parser": "^0.3.2",
 "eslint": "^8.19.0",
 "eslint-plugin-ft-flow": "^2.0.3",
 "eslint-plugin-jest": "^27.2.1",
 "eslint-plugin-only-warn": "^1.1.0",
 "eslint-plugin-react": "^7.32.2",
 "eslint-plugin-react-hooks": "^4.6.0",
 "eslint-plugin-unused-imports": "^2.0.0",
 "install-expo-modules": "^0.13.1",
 "jest": "^29.2.1",
 "lint-staged": "^13.2.2",
 "metro-react-native-babel-preset": "0.73.9",
 "node-fetch": "^3.3.2",
 "patch-package": "^8.0.0",
 "postinstall-postinstall": "^2.1.0",
 "prettier": "^2.8.8",
 "react-native-svg-transformer": "1.0.0",
 "react-test-renderer": "19.0.0",
 "typescript": "4.8.4"
 },

android/app/build.gradle

android {
 ndkVersion rootProject.ext.ndkVersion
 compileSdkVersion rootProject.ext.compileSdkVersion
 targetSdkVersion rootProject.ext.targetSdkVersion
 defaultConfig {
 minSdkVersion rootProject.ext.minSdkVersion
 targetSdkVersion rootProject.ext.targetSdkVersion
 ndk {
 abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
 }
 }
 
 buildFeatures {
 prefab true
 }
 packagingOptions {
 jniLibs {
 pickFirsts += ['**/libhermestooling.so']
 }
 resources {
 excludes += [
 "META-INF/versions/**",
 "META-INF/**/MANIFEST.MF",
 "META-INF/INDEX.LIST"
 ]
 }
 }
 
 applicationVariants.all { variant ->
 variant.outputs.each { output ->
 def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
 def abi = output.getFilter(com.android.build.OutputFile.ABI)
 if (abi != null) {
 output.versionCodeOverride = defaultConfig.versionCode * 1000 + versionCodes.get(abi)
 }
 }
 }
}
dependencies {
 implementation "com.facebook.react:react-android:0.77.0"
 if (hermesEnabled.toBoolean()) {
 implementation "com.facebook.react:hermes-android"
 } else {
 implementation jscFlavor
 }
 // other dependencies ...
}
android/build.gradle
//ANDROID?BUILD.GRADLE
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
 //* Upgraded targetSdkVersion and compileSdkVersion to android 14(level 34)
 ext {
 buildToolsVersion = "35.0.0"
 minSdkVersion = 24
 compileSdkVersion = 35
 targetSdkVersion = 35
 ndkVersion = "28.2.13676358"
 kotlinVersion = "2.0.21"
 androidToolsVersion = "8.3.2"
 }
 repositories {
 google()
 mavenCentral()
 }
 dependencies {
 classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:2.0.21'
 classpath 'com.google.gms:google-services:4.4.2'
 classpath 'com.google.firebase:firebase-crashlytics-gradle:3.0.2'
 classpath 'com.android.tools.build:gradle:8.5.2'
 }
}
// TEMP wiring – remove once the duplicate module is gone
gradle.projectsEvaluated {
 def A = rootProject.findProject(':react-native-firebase_messaging')
 def B = rootProject.findProject(':@react-native-firebase_messaging')
 if (A && B) {
 [[A,B],[B,A]].each { pair ->
 def consumer = pair[0]; def producer = pair[1]
 // parse...LocalResources should wait for the other project's package...Resources
 consumer.tasks.matching { it.name ==~ /parse.*(Release|Debug).*LocalResources/ }.configureEach {
 dependsOn producer.tasks.matching { it.name ==~ /package.*Resources/ }
 }
 // merge/extractDeepLinks should wait for the other project's generate...ResValues
 consumer.tasks.matching { it.name ==~ /(merge|extractDeepLinks).*(Release|Debug)/ }.configureEach {
 dependsOn producer.tasks.matching { it.name ==~ /generate.*ResValues/ }
 }
 }
 }
}
// Fallback: ensure all Android subprojects have compileSdkVersion/ndkVersion if their
// build.gradle doesn't set it explicitly (some third-party libs rely on the RN plugin).
subprojects { subproject ->
 afterEvaluate { p ->
 if (p.hasProperty('android')) {
 try {
 p.android.compileSdkVersion = rootProject.ext.compileSdkVersion
 if (p.android.hasProperty('ndkVersion')) {
 p.android.ndkVersion = rootProject.ext.ndkVersion
 }
 } catch (Throwable ignored) { }
 }
 }
}

What I tried

  • Set newArchEnabled=false due to build failure caused by apply plugin: "com.facebook.react" inside @onfido/react-native-sdk/android/build.gradle.

  • Upgraded React Native to 0.77.0 and aligned libraries accordingly.

  • Enabled prefab true in buildFeatures.

  • Applied packagingOptions picks and excludes.

  • Verified native .so libraries built for 16 KB page size.

  • Verified Gradle and NDK versions.

  • ABI split enabled with versionCode overrides.

Problem

  • Build passes, but app crashes at launch with missing libreact_featureflagsjni.so.

  • Native libraries still seem incompatible with 16 KB page size on Android 14+.

  • Unable to load React Native native libraries causing crash.

asked Sep 24, 2025 at 19:55
2
  • Did you already migrate to Kotlin? See also this answer Commented Oct 14, 2025 at 20:31
  • is this issue fixed? Commented Oct 19, 2025 at 16:28

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.