5

Hey folks I am facing a critical issue on project while running the app on Android. I have visited the related question but not found any solution. Error is following.

complete error:  Error: Exception in HostFunction: java.lang.UnsatisfiedLinkError: dlopen failed: library "libreanimated.so" not found
react-native version: 0.67.3
react-native-reanimated: 2.10.0

classpath("com.android.tools.build:gradle:7.0.0")

minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 31

This error is showing when I install the react-native-reanimated package if I remove this package then this error is removed but I need this package because my drawer navigation depend on this pacakge

If anyone face this issue and resolved it completely Please guide me the right direction.

1

4 Answers 4

1

I had the same issue although with more recent packages.

I found a fix here: https://github.com/software-mansion/react-native-reanimated/issues/5625

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

UPDATE: Using NDK 26 fixes this altogether, probably a better option if upgrading is not too much hassle for you.

Go to Android Studio->Tools->SDK Manager->SDK tools->Install latest version of NDK (v26)

Then run:

rm -rf node_modules
npm install 
npm start -- --reset-cache
'a'
Sign up to request clarification or add additional context in comments.

Comments

1

I have faced this same problem the solution is you have to downgrade your ndkVersion to 23.1.7779620"

also you need to install all these dependencies

"dependencies": {
"@react-native-community/masked-view": "^0.1.11",
"@react-navigation/drawer": "^6.6.15",
"@react-navigation/native": "^6.1.17",
"react": "18.2.0",
"react-native": "^0.74.1",
"react-native-gesture-handler": "^2.16.2",
"react-native-reanimated": "^3.12.0",
"react-native-safe-area-context": "^4.10.4",
"react-native-screens": "^3.31.1"},

"dependencies": { "@react-native-community/masked-view": "^0.1.11", "@react-navigation/drawer": "^6.6.15", "@react-navigation/native": "^6.1.17", "nativewind": "^2.0.11", "react": "18.2.0", "react-native": "^0.74.1", "react-native-gesture-handler": "^2.16.2", "react-native-reanimated": "^3.12.0", "react-native-safe-area-context": "^4.10.4", "react-native-screens": "^3.31.1"},

  • clear the cache

npx react-native start --reset-cache

Comments

0

Late to the party but I struggled a bit with this error.

Make sure the following:

on app/build.gradle right above this line: apply from: "../../node_modules/react-native/react.gradle" add:

project.ext.react = [
        enableHermes: true,
        bundleInDebug: true <--- make sure this is set to true
]

// also add this to force rebuild reanimated:
project.ext.reanimated = [
        buildFromSource: true
]

Comments

-1

I have been facing this issue since 2 Dec 2022. Please add the following line in your build.gradle (app) in side Android.

packagingOptions 
{   
 pickFirst 'lib/armeabi-v7a/libreanimated.so' <=== this one
}

1 Comment

the libreanimated.so file is not being included in the APK. How can this resolve the issue? This would solve if multiple .so files with the same name were found

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.