“Failed to notify dependency resolution listener.” Error when importing FirebaseUI

放肆的年华 提交于 2020-08-08 05:51:20

问题


When I implement firebaseui, I encounter this error:

Failed to notify dependency resolution listener.
The library com.google.android.gms:play-services-basement is being requested by various other libraries at [[11.0.2,11.0.2], [15.0.1,15.0.1]], but resolves to 15.0.1. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.

And this is my dependencies:

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    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.android.support:design:27.1.1'
    implementation 'com.google.firebase:firebase-core:16.0.1'
    implementation 'com.firebaseui:firebase-ui:2.1.0'
}

回答1:


Using ./gradlew app:dependencies in the Android Studio terminal will let you know which dependencies are having different versions. However, you can try updating all related dependencies.

In your root build.gradle:

dependencies {
    classpath 'com.android.tools.build:gradle:3.2.1'
    classpath 'com.google.gms:google-services:4.1.0'
    ...

In the app build.gradle:

implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.firebaseui:firebase-ui:2.1.0'

Then try to rebuild the project. This should solve the issue most of the times, also make sure you have added:

 repositories {
        // ...
        google() // Google's Maven repository
    }

In the root build.gradle.



来源:https://stackoverflow.com/questions/52912781/failed-to-notify-dependency-resolution-listener-error-when-importing-firebase

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