“无法通知依赖关系解析侦听器。”导入FirebaseUI时出错

时间:2018-10-21 06:46:52

标签: android firebaseui

实施firebaseui时,遇到此错误:

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.

这是我的依赖项:

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 个答案:

答案 0 :(得分:1)

在Android Studio终端中使用./gradlew app:dependencies将使您知道哪些依赖项具有不同的版本。但是,您可以尝试更新所有相关的依赖项。

在您的根build.gradle中:

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

在应用build.gradle中:

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

然后尝试重建项目。大多数情况下,这应该可以解决该问题,并确保已添加:

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

在根build.gradle中。