gpt4 book ai didi

android - 添加新的沙发床Lite jar 后,Android NoClassDefFoundError崩溃

转载 作者:行者123 更新时间:2023-12-03 05:15:45 25 4
gpt4 key购买 nike

使用Gradle或jars导入Couchbase Lite Android之后,发生了同样的崩溃。

由于我没有触摸代码,只是将 jar 放到“libs”文件夹中,所以无法真正弄清楚这里发生了什么。

// inside Custom Application class
@Override
public void onCreate() {
super.onCreate();
Fabric.with(this, new Crashlytics()); // <===== Crash here!
}

跟踪:
07-07 19:37:43.785  15247-15247/? E/AndroidRuntime﹕ 
FATAL EXCEPTION: main
Process: sg.com.bigspoon.www, PID: 15247
java.lang.NoClassDefFoundError: io.fabric.sdk.android.services.common.ExecutorUtils
at com.crashlytics.android.Crashlytics.<init>(Crashlytics.java:202)
at com.crashlytics.android.Crashlytics.<init>(Crashlytics.java:197)
at sg.com.bigspoon.www.data.BigSpoon.onCreate(BigSpoon.java:121)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4541)
at android.app.ActivityThread.access$1500(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1381)
at android.os.Handler.dispatchMessage(Handler.java:110)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5292)
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:828)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:644)
at dalvik.system.NativeStart.main(Native Method)

编辑:
虽然这是“固定的”。但是为什么发生这种情况仍然很奇怪。我会启发我,而是将其标记为正确答案。

最佳答案

通过在build.gradle中启用multiDex可以解决此问题

android {

defaultConfig {
// Lower than 14 doesn't support multidex
minSdkVersion 14

// Enabling multidex support.
multiDexEnabled true
}
}

dependencies {
compile 'com.android.support:multidex:1.0.1'
}

源和更多详细信息->

https://github.com/chrisjenx/Calligraphy/issues/136
https://developer.android.com/tools/building/multidex.html

关于android - 添加新的沙发床Lite jar 后,Android NoClassDefFoundError崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31267695/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com