Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libfbjni.so result: 0

I created a new react-native project and added my android native module as a dependency.using official doc https://reactnative.dev/docs/native-modules-setup

When I run this I get the error with following stack trace:

java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libfbjni.so result: 0
        at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:825)
        at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:673)
        at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:611)
        at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:559)
        at com.facebook.soloader.NativeLoaderToSoLoaderDelegate.loadLibrary(NativeLoaderToSoLoaderDelegate.java:25)
        at com.facebook.soloader.nativeloader.NativeLoader.loadLibrary(NativeLoader.java:44)
        at com.facebook.jni.HybridData.<clinit>(HybridData.java:34)
        at com.facebook.flipper.android.FlipperThread.run(FlipperThread.java:25) 

Following is my package.json

{
  "name": "albums",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint ."
  },
  "dependencies": {
    "axios": "^0.19.2",
    "react": "16.11.0",
    "react-native": "0.62.0-rc.5",
    "react-native-my-fancy-library": "../react-native-my-fancy-library/"
  },
  "devDependencies": {
    "@babel/core": "^7.9.0",
    "@babel/runtime": "^7.9.2",
    "@react-native-community/eslint-config": "^1.0.0",
    "babel-jest": "^25.3.0",
    "eslint": "^6.8.0",
    "jest": "^25.3.0",
    "metro-react-native-babel-preset": "^0.59.0",
    "react-test-renderer": "16.11.0"
  },
  "jest": {
    "preset": "react-native"
  }
}

I have already tried:

https://stackoverflow.com/a/61695629/9715339

https://stackoverflow.com/a/57155606/9715339

https://github.com/facebook/react-native/issues/25415

But none of these solved my issue.

I am a beginner in react-native. So I don't know what other details files I need to post here. Do let me know if you need any other files.

like image 718
Mayur Gajra Avatar asked May 16 '20 08:05

Mayur Gajra


1 Answers

For me the following two solved it (I think it was the latter that did it):

  1. Reset cache: react-native start --reset-cache
  2. Clean Android: cd android -> ./gradlew clean
like image 111
MikeL Avatar answered Nov 12 '22 18:11

MikeL