Android 3.1.1 - Failed resolution of: Lcom/google/android/gms/common/internal/zzbq;
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).
That worked for me I added subprojects block as below to my project gradle file
allprojects {
repositories {
//...
}
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.google.android.gms'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "+"
}
if (details.requested.group == 'com.google.firebase'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "+"
}
}
}
}
}