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

后端 未结 9 1778
天命终不由人
天命终不由人 2020-12-15 17:21

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

相关标签:
9条回答
  • 2020-12-15 17:32

    I solved this issue, update fresco library that is support for app bundle is 2.0.0 below this will not support,

    Update: For me the issue got solved after updating fresco to 2.0.0, because 1.11.0 apparently didn't have support for Android App Bundles. I don't know if you all had the same problem, though.

    just do this :

    implementation 'com.facebook.fresco:fresco:2.0.0'
    
    0 讨论(0)
  • 2020-12-15 17:34

    I had the same issue when running on Android 30. Following addition to the android/build.gradle file worked for me:

    configurations.all {
            resolutionStrategy {
               // use 0.9.0 to fix crash on Android 11
                force "com.facebook.soloader:soloader:0.9.0"
      }
    }
    

    Credits

    0 讨论(0)
  • 2020-12-15 17:36

    This has fixed my issue :

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

    This should be placed build.gradle defaultConfig section.

    0 讨论(0)
  • 2020-12-15 17:36

    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.

    0 讨论(0)
  • 2020-12-15 17:37

    if you are fresco libray then make sure use latest version and set the properties as false :

    shrinkResources false
    minifyEnabled false
    

    Inside build.gradle file.

    0 讨论(0)
  • 2020-12-15 17:48

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

    From the issue:

    React Native on Android doesn't provide a 64-bit version of the libreactnativejni.so native library, which can cause compatibility issues on 64-bit devices. I ran into this while attempting to integrate React Native with a large existing application I'm developing.

    Reaction from Facebook:

    "Thanks for reporting! Yes we don't provide 64-bit version of the native code and the system should always fall back to 32-bit."

    And:

    "Most Android projects use a number of 3rd-party libraries, and any that include native 64-bit code will cause React Native to fail."

    The following SO answer Use 32-bit jni libraries on 64-bit android explains fallback to 32-bit libraries and the fact you cannot mix. So if 64-bit is found, all should be 64-bit

    I suggest reading along the Github issue #2814. There are multiple fixes proposed, but it depends on your situation what works.

    The issuer has also written a blog about it: Mixing 32- and 64-bit Dependencies in Android

    Hope this helps!

    0 讨论(0)
提交回复
热议问题