Android ReactNative java.lang.UnsatisfiedLinkError: can find DSO to download: libreactnativejni.so

I tried to add ReactNative to my existing Android app. I followed the instructions at this link. I could add it, but the application stopped working as soon as I opened an active reaction. I started using the server

adb reverse tcp:8081 tcp:8081 

and began to respond native use

 react-native start 

I get a dialog that js files load. But, in the end, as a result of the accident. The following is the error that prints 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 because I cannot figure out the cause of this problem.

Thank you in advance.

+6
java android react-native
Apr 12 '17 at 11:59 on
source share
3 answers

This is caused by the following problem (open for 2 years) https://github.com/facebook/react-native/issues/2814

From the question:

React Native on Android does not provide a 64-bit version of libreactnativejni.so 's own library, which can cause compatibility issues on 64-bit devices. I came across this while trying to integrate React Native with a large existing application that I am developing.

Facebook reaction:

"Thank you for the message! Yes, we do not provide a 64-bit version of the native code, and the system should always return to bit 32-."

As well as:

"Most Android projects use a number of third-party libraries, and any one that includes its own 64-bit code will cause React Native to crash."

The next SO answer Using jni 32- bit libraries on a 64-bit android explains the rollback to 32- bit libraries and the fact that you cannot mix. So if 64-bit is found, everything should be 64-bit

I suggest reading the Github issue number 2814. Several fixes are proposed, but it all depends on your situation.

The issuer also wrote a blog about this: mixing 32-bit and 64-bit dependencies in Android

Hope this helps!

+6
Aug 11 '17 at 6:53 on
source share

This fixed my problem:

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

This should be placed in the build.gradle section of the defaultConfig.

+11
Jul 20 '18 at 6:18
source share

if you are using libres on a mural, make sure you are using the latest version and set the properties to false:

 shrinkResources false minifyEnabled false 

Inside the build.gradle file.

-one
Apr 26 '19 at 13:15
source share



All Articles