Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android ReactNative java.lang.UnsatisfiedLinkError:could find DSO to load: libreactnativejni.so

I have been trying to add ReactNative to my existing android application. I followed the instructions from this link. I could add it but the app gets crashed once I open the react native activity. I have started server using

adb reverse tcp:8081 tcp:8081 

and started react-native using

react-native start 

I get a dialogue that the js files are loading. But finally end up with a crash. Following is the error that is being printed in logcat:

java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libreactnativejni.so     at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:213)     at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:178)     at com.facebook.react.bridge.JSCJavaScriptExecutor.<clinit>(JSCJavaScriptExecutor.java:19)     at com.facebook.react.ReactInstanceManager.onJSBundleLoadedFromServer(ReactInstanceManager.java:413)     at com.facebook.react.ReactInstanceManager.createReactContextInBackground(ReactInstanceManager.java:236) 

I am completely lost as I am unable to figure out the cause for this issue.

Thanks in advance.

like image 913
Anudeep Avatar asked Apr 12 '17 11:04

Anudeep


2 Answers

actually in my case these steps worked:

  1. uninstall the app from the device
  2. close Metro Bundler
  3. run ./gradlew clean on android directory
  4. run react-native run-android

hope to help you.

like image 176
Ahmad Khani Avatar answered Oct 04 '22 03:10

Ahmad Khani


This has fixed my issue :

   ndk {         abiFilters 'armeabi-v7a', 'x86'     } 

This should be placed build.gradle defaultConfig section.

like image 33
Aristo Michael Avatar answered Oct 04 '22 03:10

Aristo Michael