出现DexPathList错误,现在突然崩溃我的应用程序

时间:2018-04-20 19:52:52

标签: android

我使用的是Android Studio 2.2.3。如果没有我改变一段代码,这个问题突然出现了。

FATAL EXCEPTION: main
                                                                     Process: com.grassroots.gruapp, PID: 5462
                                                                     java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/internal/zzbq;
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
                                                                         at android.app.ActivityThread.installProvider(ActivityThread.java:5103)
                                                                         at android.app.ActivityThread.installContentProviders(ActivityThread.java:4698)
                                                                         at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4638)
                                                                         at android.app.ActivityThread.access$1500(ActivityThread.java:155)
                                                                         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1384)
                                                                         at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                         at android.os.Looper.loop(Looper.java:135)
                                                                         at android.app.ActivityThread.main(ActivityThread.java:5376)
                                                                         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:908)
                                                                         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703)
                                                                      Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.common.internal.zzbq" on path: DexPathList[[zip file "/data/app/com.grassroots.gruapp-1/base.apk"],nativeLibraryDirectories=[/data/app/com.grassroots.gruapp-1/lib/arm, /vendor/lib, /system/lib]]
                                                                         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.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source) 
                                                                         at android.app.ActivityThread.installProvider(ActivityThread.java:5103) 
                                                                         at android.app.ActivityThread.installContentProviders(ActivityThread.java:4698) 
                                                                         at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4638) 
                                                                         at android.app.ActivityThread.access$1500(ActivityThread.java:155) 
                                                                         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1384) 
                                                                         at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                         at android.os.Looper.loop(Looper.java:135) 
                                                                         at android.app.ActivityThread.main(ActivityThread.java:5376) 
                                                                         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:908) 
                                                                         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703) 
                                                                        Suppressed: java.lang.ClassNotFoundException: com.google.android.gms.common.internal.zzbq
                                                                         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

我尝试过多台机器,重新调用我的项目,尝试了一个不同的稳定分支,尝试在模拟器上运行。注意:我已经启用了multiDex并且还检查了我的依赖项。

我在项目中有4个模块,具有以下依赖项

dependencies {
    compile project(':aPdfLib')
    compile project(':glibs')
    compile files('libs/BrotherPrintLibrary.jar')
    compile files('libs/MobilePrintLib.jar')
    compile files('libs/RequestService.jar')
    compile files('libs/android-async-http-1.4.2.jar')
    compile files('libs/mint-5.1.0.jar')
    compile files('libs/jsoup-1.7.2.jar')
    compile files('libs/junit-4.11.jar')
    compile files('libs/ksoap2-android-assembly-2.6.5-jar-with-dependencies.jar')
    compile files('libs/magtek-scra.jar')
    compile files('libs/org.apache.http.legacy.jar')
    compile files('libs/swiperapi-android-4.3.2.jar')
    compile files('libs/aws-android-sdk-core-2.2.10.jar')
    compile files('libs/aws-android-sdk-ses-2.2.10.jar')
    compile files('libs/mail.jar')
    compile files('libs/activation.jar')
    compile files('libs/additionnal.jar')
    compile files('libs/logback-android-1.1.1-5.jar')
    compile files('libs/slf4j-api-1.7.21.jar')
    compile files('libs/log4j-1.2.17.jar')
    compile files('libs/android-logging-log4j-1.0.3.jar')


    compile 'com.paypal.sdk:paypal-android-sdk:2.15.3'

    compile 'com.braintreepayments.api:drop-in:3.+'


    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.github.MKergall:osmbonuspack:6.3'
    compile 'org.osmdroid:osmdroid-third-party:5.6.4'
    compile 'com.squareup:android-times-square:1.6.5@aar'

    compile 'com.google.dagger:dagger:2.9'
    annotationProcessor 'com.google.dagger:dagger-compiler:2.9'
    provided 'javax.annotation:jsr250-api:1.0'


    compile 'joda-time:joda-time:2.2'

    compile 'com.android.support:design:26.0.1'
    compile 'com.android.support:support-v4:26.0.1'

    debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5'
    releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'

    compile 'com.jakewharton.hugo:hugo-runtime:1.2.1'
    debugCompile 'com.jakewharton.hugo:hugo-runtime:1.2.1'
    compile 'com.jakewharton:butterknife:8.5.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'

    compile 'com.github.GrenderG:Toasty:1.1.4'

    compile 'org.sufficientlysecure:html-textview:3.4'
}

2.) 

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:26.0.1'
    testCompile 'junit:junit:4.12'

    //gson
    compile 'com.google.code.gson:gson:2.8.0'

    //streaming
    compile 'com.annimon:stream:1.1.5'

    //dagger
    compile 'com.google.dagger:dagger:2.9'
    annotationProcessor 'com.google.dagger:dagger-compiler:2.9'
    provided 'javax.annotation:jsr250-api:1.0'

    //retrofit
    compile 'com.squareup.retrofit2:retrofit:2.2.0'
    compile 'com.squareup.retrofit2:converter-gson:2.2.0'
    compile 'com.squareup.retrofit2:adapter-rxjava2:2.2.0'

    //rxJava
    compile 'com.jakewharton.rxbinding2:rxbinding:2.1.1'
    compile 'io.reactivex.rxjava2:rxandroid:2.0.2'
    compile 'io.reactivex.rxjava2:rxjava:2.0.8'

    //okhttp
    compile 'com.squareup.okhttp3:okhttp:3.6.0'
    compile 'com.squareup.okhttp3:logging-interceptor:3.6.0'

    //bottleneck analysis
    compile 'com.jakewharton.hugo:hugo-runtime:1.2.1'
    debugCompile 'com.jakewharton.hugo:hugo-runtime:1.2.1'
}

3.) 

dependencies {
    compile 'com.jakewharton:butterknife:8.5.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'

    compile 'com.android.support:multidex:1.0.1'

    internalDebugCompile 'com.jakewharton.hugo:hugo-runtime:1.2.1'
    compile 'com.jakewharton.hugo:hugo-runtime:1.2.1'
    compile 'org.sufficientlysecure:html-textview:3.4'
}

4.) 

dependencies {
    compile 'com.android.support:support-v4:26.0.1'
    compile files('libs/com.radaee.view.jar')
}

1 个答案:

答案 0 :(得分:0)

这种依赖性是可疑的

compile 'com.braintreepayments.api:drop-in:3.+'

您可以尝试依赖确切的版本

compile 'com.braintreepayments.api:drop-in:3.2.1'

如果它解决了您的问题,可能您的版本3.3.0(最新版本)

有问题