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

前端 未结 10 2232
忘掉有多难
忘掉有多难 2020-11-28 15:02

since I\'ve updated to Android Studio 3.1, my project is not running anymore. I have searched for a solution all over the internet with no positive results. Here\'s the erro

相关标签:
10条回答
  • 2020-11-28 15:21

    Step 1:

    This kind of error throw the some logs. Read it carefully to find out which dependency cause this issue

    Step 2:

    Update that dependency to latest version.

    For ex: In my case it throw the error in material design dependency. I just update that dependency to latest version - problem solved

    My error log - Didn't find class "com.google.android.material.tabs........"

    0 讨论(0)
  • 2020-11-28 15:22

    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).

    0 讨论(0)
  • 2020-11-28 15:24

    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"
    
    0 讨论(0)
  • 2020-11-28 15:27

    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'
    
    0 讨论(0)
  • 2020-11-28 15:28

    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

    0 讨论(0)
  • 2020-11-28 15:28

    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.

    0 讨论(0)
提交回复
热议问题