react-native-reanimated
react-native-reanimated copied to clipboard
Error: Exception in HostFunction: java.lang.UnsatisfiedLinkError: dlopen failed: library "libreanimated.so" not found
Description
I am getting this error when I build a new app from scratch with react native 0.73.3 and react-native-reanimated 3.6.2
Error: Exception in HostFunction: java.lang.UnsatisfiedLinkError: dlopen failed: library "libreanimated.so" not found, js engine: hermes
at App (http://localhost:8081/index.bundle//&platform=android&dev=true&lazy=true&minify=false&app=com.animtest&modulesOnly=false&runModule=true:125577:54)
at RCTView
at View (http://localhost:8081/index.bundle//&platform=android&dev=true&lazy=true&minify=false&app=com.animtest&modulesOnly=false&runModule=true:60116:43)
at RCTView
at View (http://localhost:8081/index.bundle//&platform=android&dev=true&lazy=true&minify=false&app=com.animtest&modulesOnly=false&runModule=true:60116:43)
at AppContainer (http://localhost:8081/index.bundle//&platform=android&dev=true&lazy=true&minify=false&app=com.animtest&modulesOnly=false&runModule=true:59958:36)
at AnimTest(RootComponent) (http://localhost:8081/index.bundle//&platform=android&dev=true&lazy=true&minify=false&app=com.animtest&modulesOnly=false&runModule=true:111059:28)
ERROR Error: Exception in HostFunction: java.lang.UnsatisfiedLinkError: dlopen failed: library "libreanimated.so" not found, js engine: hermes
at App (http://localhost:8081/index.bundle//&platform=android&dev=true&lazy=true&minify=false&app=com.animtest&modulesOnly=false&runModule=true:125577:54)
at RCTView
at View (http://localhost:8081/index.bundle//&platform=android&dev=true&lazy=true&minify=false&app=com.animtest&modulesOnly=false&runModule=true:60116:43)
at RCTView
at View (http://localhost:8081/index.bundle//&platform=android&dev=true&lazy=true&minify=false&app=com.animtest&modulesOnly=false&runModule=true:60116:43)
at AppContainer (http://localhost:8081/index.bundle//&platform=android&dev=true&lazy=true&minify=false&app=com.animtest&modulesOnly=false&runModule=true:59958:36)
at AnimTest(RootComponent) (http://localhost:8081/index.bundle//&platform=android&dev=true&lazy=true&minify=false&app=com.animtest&modulesOnly=false&runModule=true:111059:28)
ERROR TypeError: Cannot read property 'makeMutable' of undefined
This error is located at:
in App
in RCTView (created by View)
in View (created by AppContainer)
in RCTView (created by View)
in View (created by AppContainer)
in AppContainer
in AnimTest(RootComponent), js engine: hermes
ERROR TypeError: Cannot read property 'makeMutable' of undefined
This error is located at:
in App
in RCTView (created by View)
in View (created by AppContainer)
in RCTView (created by View)
in View (created by AppContainer)
in AppContainer
in AnimTest(RootComponent), js engine: hermes
Steps to reproduce
- Create a new project with
npx react-native@latest init AwesomeProject
- Install react-native-reanimated by following the steps in https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/getting-started
- Create a basic animation with https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/your-first-animation
- Connect an android device via ADB.
- Run the debug build on android, by
npm start
and pressinga
https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/your-first-animation
Snack or a link to a repository
https://github.com/SounakB/reanimated-build-error
Reanimated version
^3.6.2
React Native version
0.73.3
Platforms
Android
JavaScript runtime
Hermes
Workflow
React Native
Architecture
Paper (Old Architecture)
Build type
Debug app & dev bundle
Device
Real device
Device model
Vivo Y22 (Android 13)
Acknowledgements
Yes
Hi! Does your app work in simulator? Also you run it without Android Studio, do you?
I have the same issue with his setup. It does not work on a simulator. Help here is needed even if it's a patch.
Hi! Does your app work in simulator? Also you run it without Android Studio, do you?
@Latropos The app works on the simulator without any error, I have the android studio installed but I run it from terminal with npm start
then press a
for android as shown in the menu.
Currently I have downgraded to react-native 0.71.14 and react-native-reanimated 3.5.4 to avoid this problem
I will test downgrading gradle plugin to see if it fixes the problem
React Native 0.73 comes by default with ndk = 25.1.8937393. To fix it, I had to drop the NDK to 23.1.7779620
Here is solution that worked for me
// android/build.gradle
buildscript {
ext {
buildToolsVersion = "34.0.0"
minSdkVersion = 21
compileSdkVersion = 34
targetSdkVersion = 34
-- ndkVersion = "25.1.8937393"
++ ndkVersion = "23.1.7779620"
kotlinVersion = "1.8.0"
}
Before adopting this I tested a lot of possibilities, even tested the example app from reanimated it self and the issue was still present. I will adopt this as a temporary solution until they properly upgrade the SDK to work with react-native 0.73 which uses ndk 25.
I've seen this PR early this #5587 morning that went in. But does not seem to fix the issue.
React Native 0.73 viene por defecto con ndk = 25.1.8937393. Para solucionarlo, tuve que colocar el NDK en 23.1.7779620.
Aquí está la solución que funcionó para mí.
// android/build.gradle buildscript { ext { buildToolsVersion = "34.0.0" minSdkVersion = 21 compileSdkVersion = 34 targetSdkVersion = 34 -- ndkVersion = "25.1.8937393" ++ ndkVersion = "23.1.7779620" kotlinVersion = "1.8.0" }
Antes de adoptar esto, probé muchas posibilidades, incluso probé la aplicación de ejemplo reanimada y el problema seguía presente. Adoptaré esto como una solución temporal hasta que actualicen adecuadamente el SDK para que funcione con reaccionar-nativo 0.73 que usa ndk 25.
Vi este PR temprano esta mañana # 5587 que entró. Pero no parece solucionar el problema.
muchas gracias compa, estuve alrededor de 3 dias tratando de solucionar este problema con google, IA, Stackoverflow, cantidades de informacion y trate de todo y nada me funcionaba hasta que lei tu solucion, Gracias por tu aporte
We are seeing this issue in our crashlytics on all OnePlus8Pro devices. We are using version 2.14.4. Any other device works ok. Any idea?