前使用RN版本号: 0.62.2 ,将项目打包release 的 apk 时 ,安装后打开App闪退,完整错误如下:
2020-06-04 17:28:25.648 1375-1391/? E/SoLoader: couldn't find DSO to load: libhermes.so --------- beginning of crash2020-06-04 17:28:25.649 1375-1391/? E/AndroidRuntime: FATAL EXCEPTION: create_react_context Process: com.microrelay, PID: 1375 java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes.so at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:789) at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:639) at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:577) at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:525) at com.facebook.hermes.reactexecutor.HermesExecutor.<clinit>(HermesExecutor.java:20) at com.facebook.hermes.reactexecutor.HermesExecutorFactory.create(HermesExecutorFactory.java:29) at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:997) at java.lang.Thread.run(Thread.java:764)
一番搜索找到解决方案:( 原 issues 地址:https://github.com/facebook/react-native/issues/25923 )
在 android/app/build.gradle 文件中 添加如下配置:
configurations.all { resolutionStrategy { force "com.facebook.soloader:soloader:0.8.2" }}