In project 'app' a resolved Google Play services library dependency depends on another at an exact version

后端 未结 22 1856
情话喂你
情话喂你 2020-12-08 13:42

Trying to create a simple app with FireStore and Google Authentication. Having problem with the gradle:

In project \'app\' a resolved Google Play serv

相关标签:
22条回答
  • 2020-12-08 13:57

    I resolved it by simply clearing the app-level dependencies block leaving just the default Android dependencies like so:

    dependencies {
      testImplementation 'junit:junit:4.12'
      androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
      androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'
      implementation 'androidx.multidex:multidex:2.0.0'
    }
    
    0 讨论(0)
  • 2020-12-08 13:58

    The working solution for me was to remove "firebase-auth" and add "firebase-core" dependency. But after a couple of project rebuilds I started experiencing another compilation issue so I had to add the "firebase-auth" dependency in addition to the "firebase-core" in order to make it work:

    implementation 'com.google.firebase:firebase-auth:19.0.0'
    implementation 'com.google.firebase:firebase-core:17.0.1'
    implementation 'com.firebaseui:firebase-ui-auth:4.3.1'
    
    0 讨论(0)
  • 2020-12-08 14:02

    The problem was it was missing a dependency. Adding com.google.firebase:firebase-auth solved the issue.

    dependencies {
        implementation fileTree(dir: 'libs', include: ['*.jar'])
        implementation 'com.android.support:appcompat-v7:27.1.1'
        implementation 'com.android.support.constraint:constraint-layout:1.1.3'
        testImplementation 'junit:junit:4.12'
        androidTestImplementation 'com.android.support.test:runner:1.0.2'
        androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
        implementation 'com.google.firebase:firebase-firestore:17.1.5'
    
    //    implementation'com.google.firebase:firebase-core:16.0.6'
    //    implementation'com.google.firebase:firebase-storage:16.0.5'
    
        implementation'com.google.firebase:firebase-auth:16.1.0' => add this line
        implementation 'com.firebaseui:firebase-ui-auth:4.2.0'
    }
    
    0 讨论(0)
  • 2020-12-08 14:02

    The problem was fixed after upgrading this lib in my project's build.gradle:

    classpath 'com.google.gms:google-services:4.3.3'
    

    and these ones in the app module's build.gradle:

    implementation 'com.google.firebase:firebase-core:17.3.0'
    implementation 'com.google.firebase:firebase-messaging:20.1.5'
    

    After this, use Android Studio's Clean menu

    0 讨论(0)
  • 2020-12-08 14:02

    The ML Kit library had versioning problems in the latest release.

    Google Play services library dependency depends on another at an exact version error (thrown by the google-services plugin)

    Here is the link to the solution. https://firebase.google.com/support/release-notes/android#bom_v25-8-0

    0 讨论(0)
  • 2020-12-08 14:05

    There was a bug related to google-services that was eventually fixed in version 4.3.3.

    So you can either use 4.3.3 or the latest version (check here)

    classpath 'com.google.gms:google-services:4.3.3' // or latest version
    

    or downgrade to 4.1.0

    classpath 'com.google.gms:google-services:4.1.0'
    
    0 讨论(0)
提交回复
热议问题