react-native-reanimated: 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 startand 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
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 6
- Comments: 16 (1 by maintainers)
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
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.
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
facing the same issue during the react-native upgrade from 0.67.3 to 0.74.0
Had the same issue on RN 72. Updated react-native-reanimated to 3.15 (last compatible with my react-native version) and the issue is gone. As written in reanimated docs there’s no breaking changes between version 2 and 3, so could be painless. Also during update make sure to remove some old reanimated configurations if present. Like
import com.swmansion.reanimated.ReanimatedJSIModulePackage;etc…