Migrating from expo to react native crashes the app #9309
Unanswered
priyammishra
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am migrating from an expo app to react native app. I removed all expo dependencies using npm uninstall command and now I am trying to build the local set up. Initially, I faced a lot of issues in android folder so I created a fresh react-native project using init command via react-native cli and copied the android folder from this newly created app and pasted it in my current project. I run two commands - npx react-native start and npx react-native run-android. Build is now successful but when I try to open the app, it stays there for few seconds and then it minimizes/crashes on its own. How to resolve this?
Inside abd logs, I am getting this error - AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: library "libreact_featureflagsjni.so" not found
Please help me.
package.json
{
"name": "@mobile/mobile-app",
"main": "dev/index.ts",
"version": "1.0.12",
"scripts": {
"start": "react-native start",
"android": "react-native run-android --no-packager",
"start-reset": "react-native start --reset-cache",
"prepublishOnly": "node -e "const p=require('./package.json');p.main='src/index.ts';require('fs').writeFileSync('./package.json',JSON.stringify(p,null,2))"",
"postpublish": "node -e "const p=require('./package.json');p.main='dev/index.ts';require('fs').writeFileSync('./package.json',JSON.stringify(p,null,2))""
},
"dependencies": {
"react": "19.2.3",
"react-native": "0.85.2",
"@react-native/new-app-screen": "0.85.2",
"react-native-safe-area-context": "^5.5.2",
"@gorhom/bottom-sheet": "^5.2.8",
"@react-native-community/datetimepicker": "^8.6.0",
"@react-native-picker/picker": "^2.11.4",
"@react-navigation/bottom-tabs": "^7.4.0",
"@react-navigation/elements": "^2.6.3",
"@react-navigation/material-top-tabs": "^7.4.13",
"axios": ">=1.0.0",
"base-64": "^1.0.0",
"i18n-js": "^4.5.1",
"jwt-decode": "^4.0.0",
"react-native-calendars": "^1.1314.0",
"react-native-easy-grid": "^0.2.2",
"react-native-fs": "^2.20.0",
"react-native-image-zoom-viewer": "^3.0.1",
"react-native-timeline-flatlist": "^1.0.0",
"react-native-vector-icons": "^10.3.0"
},
"peerDependencies": {
"@cx-common/auth": "",
"@cx-common/env-config": "",
"@cx-common/mobile-navigation": "*",
"@react-navigation/native": ">=7.0.0",
"axios": ">=1.0.0",
"react": ">=18.0.0",
"react-native": ">=0.72.0",
"react-native-gesture-handler": ">=2.0.0",
"react-native-reanimated": ">=3.0.0",
"react-native-screens": ">=3.0.0",
"react-native-svg": ">=13.0.0"
},
"devDependencies": {
"@react-native-community/cli": "^20.1.3",
"@react-native-community/cli-platform-android": "20.1.0",
"@react-native-community/cli-platform-ios": "20.1.0",
"@react-native/metro-config": "0.85.2",
"@react-native/typescript-config": "0.85.2",
"@react-navigation/native-stack": "^7.14.11",
"@sentry/core": "^10.38.0",
"@types/base-64": "^1.0.2",
"@types/react": "~19.1.0",
"@types/react-native-vector-icons": "^6.4.18",
"@types/react-test-renderer": "^19.1.0",
"eslint": "^9.25.0",
"react-dom": "19.1.0",
"react-native-app-auth": "^8.1.0",
"react-native-gesture-handler": "~2.28.0",
"react-native-screens": "~4.16.0",
"react-native-svg": "^15.15.3",
"react-native-web": "~0.21.0",
"typescript": "^5.8.3"
},
"private": false
}
build.gradle
buildscript {
ext {
buildToolsVersion = "36.0.0"
minSdkVersion = 24
compileSdkVersion = 36
targetSdkVersion = 36
ndkVersion = "27.1.12297006"
kotlinVersion = "2.1.20"
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
}
}
apply plugin: "com.facebook.react.rootproject"
gradle.properties
org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
android.useAndroidX=true
reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
newArchEnabled=true
hermesEnabled=true
edgeToEdgeEnabled=false
settings.gradle
pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") }
plugins { id("com.facebook.react.settings") }
extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() }
rootProject.name = 'mobileapp'
include ':app'
includeBuild('../node_modules/@react-native/gradle-plugin')
app>build.gradle
apply plugin: "com.android.application"
apply plugin: "org.jetbrains.kotlin.android"
apply plugin: "com.facebook.react"
react {
}
def enableProguardInReleaseBuilds = false
def jscFlavor = 'io.github.react-native-community:jsc-android:2026004.+'
android {
ndkVersion rootProject.ext.ndkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
compileSdk rootProject.ext.compileSdkVersion
}
dependencies {
implementation("com.facebook.react:react-android")
}
Mainapplication.kt
package com.mobileapp
import android.app.Application
import com.facebook.react.PackageList
import com.facebook.react.ReactApplication
import com.facebook.react.ReactNativeHost
import com.facebook.react.ReactPackage
import com.facebook.react.defaults.DefaultReactNativeHost
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
import com.facebook.soloader.SoLoader
class MainApplication : Application(), ReactApplication {
}
}
Mainactivity.kt
package com.mobileapp
import android.os.Bundle
import com.facebook.react.ReactActivity
import com.facebook.react.ReactActivityDelegate
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
import com.facebook.react.defaults.DefaultReactActivityDelegate
class MainActivity : ReactActivity() {
override fun getMainComponentName(): String = "mobileapp"
override fun createReactActivityDelegate(): ReactActivityDelegate =
DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
}
androidmanifest.xml
Beta Was this translation helpful? Give feedback.
All reactions