简体   繁体   中英

Didn't find class “com.google.android.gms.common.internal.zzbq” on path: DexPathList

My Gradle File:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion '26.0.1'
    defaultConfig {
        applicationId "com.mystorie.totheworld"
        minSdkVersion 17
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

        // Enabling multidex support.
        multiDexEnabled true

        aaptOptions { cruncherEnabled = false }

    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    dexOptions { javaMaxHeapSize "4g" }

}

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.squareup.okhttp3:okhttp:+'
    //noinspection GradleCompatible
    compile 'com.android.support:appcompat-v7:26.1.0'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.parse:parse-android:+'
    compile 'com.parse.bolts:bolts-android:1.+'
    //noinspection GradleCompatible
    compile 'com.google.android.gms:play-services:+'
    compile 'com.google.android.gms:play-services-ads:+'
    compile 'de.hdodenhof:circleimageview:2.2.0'
    compile 'com.facebook.android:facebook-android-sdk:4.+'
    compile 'com.parse:parsefacebookutils-v4-android:1.10.3@aar'
    compile 'com.google.android.gms:play-services-gcm:+'
    testCompile 'junit:junit:4.12'
}

This is the error I received

E/AndroidRuntime: FATAL EXCEPTION: main Process: com.mystorie.totheworld, PID: 16152 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:6420) at android.app.ActivityThread.installContentProviders(ActivityThread.java:6012) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5951) at android.app.ActivityThread.-wrap3(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1710) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6776) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1518) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408) Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.common.internal.zzbq" on path: DexPathList[[zip file "/data/app/com.mystorie.totheworld-1/base.apk", zip file "/da ta/app/com.mystorie.totheworld-1/split_lib_dependencies_apk.apk", zip file "/data/app/com.mystorie.totheworld-1/split_lib_slice_0_apk.apk", zip file "/data/app/com.mystorie.totheworld-1/split_lib_slice_1_apk.apk", zip file "/data/app/com.mystorie.totheworld-1/split_lib_slice_2_apk.apk", zip file "/data/app/com.mystorie.totheworld-1/split_lib_slice_3_apk.apk", zip file "/data/app/com.mystorie.totheworld-1/split_lib_slice_4_apk.apk", zip file "/data/app/com.mystorie.totheworld-1/split_lib_slice_5_apk.apk", zip file "/data/app/com.mystorie.totheworld-1/split_lib_slice_6_apk.apk", zip file "/data/app/com.mystorie.totheworld-1/split_lib_slice_7_apk.apk", zip file "/data/app/com.mystorie.totheworld-1/split_lib_slice_8_apk.apk", zip file "/data/app/com.mystorie.totheworld-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.mystorie.totheworld-1/lib/arm, /system/lib, /vendor/lib]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) at java.lang.ClassLoad er.loadClass(ClassLoader.java:380) at java.lang.ClassLoader.loadClass(ClassLoader.java:312) at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source) at android.app.ActivityThread.installProvider(ActivityThread.java:6420) at android.app.ActivityThread.installContentProviders(ActivityThread.java:6012) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5951) at android.app.ActivityThread.-wrap3(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1710) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6776) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1518) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408) Disconnected from the target VM, address: 'localhost:8600', transport: 'socket'

This is because you have multiple version of Google Play Services with the following dependencies:

implementation 'com.google.android.gms:play-services:12.0.1'
implementation 'com.google.android.gms:play-services-ads:+'

So, you need to remove the following:

implementation 'com.google.android.gms:play-services:12.0.1'

And use only one version of the library:

implementation 'com.google.android.gms:play-services-ads:+'

It should be remove your error

I had this problem and I solved it thanks to this other answer.

Android 3.1.1 - Failed resolution of: Lcom/google/android/gms/common/internal/zzbq

The problem is the lack of this dependency in the gradle file

implementation 'com.android.support:multidex:1.0.3'

If you update your project to AndroidX.

Then remove

implementation 'com.google.android.gms:play-services:12.0.1'

and make sure all of your com.google.android.gms dependencies are same version .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM