多索引安装失败
2022-09-03 07:55:19
我正在使用CircledImageView库。它在棒棒糖+安卓版本上工作正常。但是在kitkat中,它正在崩溃。所以在谷歌上搜索后。我发现我必须在我的应用程序中实现multidex。
这就是我的应用程序类。
public class FireApp extends Application {
@Override
public void onCreate() {
super.onCreate();
Firebase.setAndroidContext(this);
Fresco.initialize (this);
}
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
}
在 build.gradle 中,默认配置 MultiDexEnabled 是 true
multiDexEnabled true
但是当我运行该应用程序时,我收到以下错误。
java.lang.NoSuchFieldException: Field dexElementsSuppressedExceptions not found in class dalvik.system.PathClassLoader
at android.support.multidex.MultiDex.findField(MultiDex.java:288)
at android.support.multidex.MultiDex.access$300(MultiDex.java:57)
at android.support.multidex.MultiDex$V19.install(MultiDex.java:390)
at android.support.multidex.MultiDex$V19.access$000(MultiDex.java:369)
at android.support.multidex.MultiDex.installSecondaryDexes(MultiDex.java:242)
at android.support.multidex.MultiDex.install(MultiDex.java:161)
at android.support.multidex.MultiDexApplication.attachBaseContext(MultiDexApplication.java:39)
at com.buckydroid.anonchat.FireApp.attachBaseContext(Unknown Source)
at android.app.Application.attach(Application.java:182)
at android.app.Instrumentation.newApplication(Instrumentation.java:991)
at android.app.Instrumentation.newApplication(Instrumentation.java:975)
at android.app.LoadedApk.makeApplication(LoadedApk.java:511)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4564)
at android.app.ActivityThread.access$1500(ActivityThread.java:139)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1353)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:149)
at android.app.ActivityThread.main(ActivityThread.java:5268)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609)
at dalvik.system.NativeStart.main(Native Method)