尝试在Android应用中初始化本机组件时,在 Android操作系统版本 4.4.2 和 4.2.2 上出现此错误。
致命异常:java.lang.VerifyError:com / facebook / soloader / g at com.facebook.soloader.SoLoader.initImpl $ 1a54e370(SoLoader.java:189)at at com.facebook.soloader.SoLoader.init(SoLoader.java:1105)at com.facebook.react.ReactInstanceManager.initializeSoLoaderIfNecessary(ReactInstanceManager.java:1358) 在 com.facebook.react.ReactInstanceManagerBuilder.build(ReactInstanceManagerBuilder.java:227)
答案 0 :(得分:3)
修复崩溃:
# SoLoader
-keep class com.facebook.soloader.** { *; }
-keepclassmembers class com.facebook.soloader.SoLoader {
static <fields>;
}
答案 1 :(得分:0)
Add implementation 'com.android.support:multidex:1.0.3' to dependencies in app/build.gradle
In MainApplication.java:
import androidx.multidex.MultiDex; // Note: You might need to replace this with:
import android.support.multidex.Multidex;
import android.content.Context;
Add following to MainApplication.java:
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}