对于这个问题,我在很多方面尝试了很多解决方案但是无法解决。我已经使我的项目启用了multidex,并且应用程序扩展了MultiDexApplication。
有
java.lang.NoClassDefFoundError:解析失败:Lcom / crashlytics / android / beta / Beta问题
我试图在里面应用proguard规则来保留这个类,但是同样的旧规则完全没有成功。
我很困惑这里面的问题是什么。
这是我在应用程序的build.gradle
中的依赖项dependencies {
// compile 'com.android.support:support-v4:21+'
compile 'com.google.code.gson:gson:2.7'
//compile 'com.android.support:appcompat-v7:19+'
compile 'com.android.support:appcompat-v7:26.0.1'
compile 'com.android.support:design:26.0.1'
compile 'com.android.support:recyclerview-v7:26.0.1'
compile fileTree(include: ['*.jar'], dir: '../../libs/')
compile fileTree(include: '*.jar', dir: 'libs')
compile 'com.squareup.picasso:picasso:2.3.2'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.squareup.okhttp:okhttp:2.7.2'
compile('de.keyboardsurfer.android.widget:crouton:1.8.4@aar') {
// exclusion is not neccessary, but generally a good idea.
exclude group: 'com.google.android', module: 'support-v4'
}
compile 'com.nineoldandroids:library:2.4.0'
compile 'net.hockeyapp.android:HockeySDK:3.0.2'
compile project(':FlipLibrary')
compile project(':SubsamplingImageView')
compile('de.greenrobot:eventbus:2.4.0') {
exclude group: 'com.google.android', module: 'support-v4'
}
compile 'com.jakewharton:butterknife:5.1.0'
compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
compile('com.viewpagerindicator:library:2.4.1@aar') {
// exclusion is not neccessary, but generally a good idea.
exclude group: 'com.google.android', module: 'support-v4'
}
compile 'com.github.dmytrodanylyk.android-process-button:library:1.0.1'
compile project(':NewFlipLibrary')
compile 'com.newrelic.agent.android:android-agent:4.273.4'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.7.2'
// compile 'se.emilsjolander:android-flipview:+'
compile 'com.parse.bolts:bolts-android:1.4.0'
//fordatabse
compile 'com.facebook.stetho:stetho:1.5.0'
compile files('libs/craftar-on-device-image-recognition-sdk-android.jar')
compile files('libs/sanselan-0_97-android-1.0.0.jar')
compile 'com.android.support:multidex:1.0.3'
compile 'com.google.firebase:firebase-messaging:11.4.2'
compile 'com.google.android.gms:play-services:11.4.2'
compile 'com.google.android.gms:play-services-location:11.4.2'
compile 'com.google.android.gms:play-services-maps:11.4.2'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.intuit.sdp:sdp-android:1.0.5'
compile('com.crashlytics.sdk.android:crashlytics:2.9.2@aar') {
transitive = true;
}
compile 'com.flurry.android:analytics:6.3.1'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.uncopt:android.justified:1.0'
compile 'uk.co.chrisjenx:calligraphy:2.3.0'
}
以下是整个崩溃日志:
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/crashlytics/android/beta/Beta;
at com.crashlytics.android.Crashlytics.<init>(Crashlytics.java:29)
at cz.ackee.cubeplatform.App.onCreate(App.java:59)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1016)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4795)
at android.app.ActivityThread.access$1500(ActivityThread.java:176)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1498)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5576)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:956)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:751)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.crashlytics.android.beta.Beta" on path: DexPathList[[zip file "/data/app/com.package-2/base.apk", zip file "/data/app/com.package-2/split_lib_dependencies_apk.apk", zip file "/data/app/com.package-2/split_lib_slice_0_apk.apk", zip file "/data/app/com.package-2/split_lib_slice_1_apk.apk", zip file "/data/app/com.package-2/split_lib_slice_2_apk.apk", zip file "/data/app/com.package-2/split_lib_slice_3_apk.apk", zip file "/data/app/com.package-2/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[2/lib/arm64, /vendor/lib64, /system/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at com.crashlytics.android.Crashlytics.<init>(Crashlytics.java:29)
at cz.ackee.cubeplatform.App.onCreate(App.java:59)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1016)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4795)
at android.app.ActivityThread.access$1500(ActivityThread.java:176)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1498)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5576)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:956)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:751)
Suppressed: java.lang.ClassNotFoundException: com.crashlytics.android.beta.Beta
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 14 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
如上所述,我的依赖项和崩溃日志已添加
答案 0 :(得分:0)
尝试更新所有依赖项,并更新您的Google Play服务。 并确保defaultConfig { multiDexEnabled是的 在你的gradle中