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

余生长醉 提交于 2019-11-27 09:26:11

Try adding this dependency to your gradle file:

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

Also you should use the same versions for the support and play services libraries. And you should avoid using "+" for latest version. Change this part:

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

into this:

implementation 'com.google.android.gms:play-services-maps:12.0.1'
implementation 'com.google.android.gms:play-services-auth:12.0.1'
implementation 'com.google.android.gms:play-services-location:12.0.1'
implementation 'com.google.android.gms:play-services:12.0.1'
implementation 'com.google.android.gms:play-services-ads:12.0.1'

EDIT: You may also add this part to your app level gradle file and try again. I did not see anyone tried this but it may work.

allprojects {
    repositories {
       //...
    }

    subprojects {
        project.configurations.all {
            resolutionStrategy.eachDependency { details ->
                if (details.requested.group == 'com.google.android.gms'
                && !details.requested.name.contains('multidex') ) {
                    details.useVersion "12.0.1"
                }
            }
        }
    }
}

2ND UPDATE: Just seen this, the dependency below, covers all the others, then it may cause a duplication issue. Remove the other dependencies and leave this one:

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

I had the same issue and I solved it.Update all your com.google.android.gms:play-services dependencies to 15.0.0. It should look like this:

implementation 'com.google.android.gms:play-services-maps:15.0.0'
implementation 'com.google.android.gms:play-services-auth:15.0.0'
implementation 'com.google.android.gms:play-services-location:15.0.0'
implementation 'com.google.android.gms:play-services:15.0.0'
implementation 'com.google.android.gms:play-services-ads:15.0.0'

Once you do that, it should fix the issue with finding the NoClassDefFoundError error (at least it did for me).

You may be using different verions of libraries.

Important point is you may be using an external library which is using a different play services version (may be older) . Please check care fully all external libraries updates and match them all

I solved it by removing

implementation "com.google.android.gms:play-services:$play_service_version"

and keeping only important dependencies.

In my case I had

implementation "com.google.android.gms:play-services:$play_service_version"
implementation "com.google.android.gms:play-services-location:$play_service"

And I removed

implementation "com.google.android.gms:play-services:$play_service_version"

and kept

implementation "com.google.android.gms:play-services-location:$play_service"

Here play_service_version & play_service are versions

implementation 'com.google.android.gms:play-services-maps:15.0.0'
implementation 'com.google.android.gms:play-services-auth:15.0.0'
implementation 'com.google.android.gms:play-services-location:15.0.0'
implementation 'com.google.android.gms:play-services:15.0.0'
implementation 'com.google.android.gms:play-services-ads:15.0.0'

This helped me.

@cubycode I am also running into the same issue and I tried all solutions listed here.

I received the same error even with the 'zzbq;' at the end

In app build.gradle I had to update my com.google.firebase:firebase-core to 16.0.1 to match the same line in the react-native-firebase build.gradle

Example:

app/build.gradle

implementation 'com.google.firebase:firebase-core:16.0.1'

react-native-firebase/android/build.gradle

compileOnly "com.google.firebase:firebase-core:16.0.1"

I had exactly the same problem. I tried quite a few things, but here's what actually helped.

I added this to my project: implementation 'com.google.android.gms:play-services-base:16.0.1'.

The error went away.

Then I removed it. Everything was still fine. Cleaned the project - still no error.

Don't ask me for logic behind this, it just worked for me, that's all I know.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!