
adb reverse tcp:8081 tcp:8081
并开始使用本机
react-native start
我得到一个对话框,提示js文件正在加载.但是最后以崩溃告终.以下是在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)
我完全迷路了,因为我无法找出导致此问题的原因.
提前致谢.
从问题:
React Native on Android doesn’t provide a 64-bit version of the
libreactnativejni.sonative 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.
来自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.“
以下SO回答Use 32-bit jni libraries on 64-bit android解释了回退到32位库以及您无法混合使用的事实.因此,如果找到64位,则所有都应为64位
我建议阅读Github问题#2814.建议了多个修复程序,但是哪种方法有效取决于您的情况.
发行人还写了一个博客:Mixing 32- and 64-bit Dependencies in Android
希望这可以帮助!
转载注明原文:Android ReactNative java.lang.UnsatisfiedLinkError:可以找到要加载的DSO:libreactnativejni.so - 乐贴网