关于android:为firebase-ui-auth添加依赖项时出错:2.3.0

Error in adding dependency for firebase-ui-auth:2.3.0

从昨天开始,我就面临这个问题。

1
2
3
4
5
//Add Library
compile 'com.android.support:design:26.1.0'
compile 'com.firebaseui:firebase-ui:0.2.0'
compile 'com.google.android.gms:play-services-auth:11.2.2'
compile 'com.google.firebase:firebase-auth:11.2.2'

该应用程序剩下的唯一代码是:

1
compile 'com.firebaseui:firebase-ui-auth:2.3.0'

添加此内容后,我立即收到错误消息:

Error:Execution failed for task ':app:processDebugManifest'.
Manifest merger failed : Attribute meta-data#android.support.VERSION@value value=(26.1.0) from [com.android.support:design:26.1.0] AndroidManifest.xml:28:13-35
is also present at [com.android.support:customtabs:26.0.1] AndroidManifest.xml:25:13-35 value=(26.0.1).
Suggestion: add 'tools:replace="android:value"' to element at AndroidManifest.xml:26:9-28:38 to override.

我已经尝试编译'com.firebaseui:firebase-ui-auth:1.2.0',但是没有用。

需要一些帮助! 提前致谢 :)


在firebase UI自述文件中检查以下链接:

If you would like to use a newer version of one of FirebaseUI's transitive dependencies, such as Firebase, Play services, or the Android support libraries, you need to add explicit compile declarations in your build.gradle for all of FirebaseUI's dependencies at the version you want to use.

例如,如果您想使用Play服务/ Firebase版本FOO和支持库版本BAR,请为您使用的每个FirebaseUI模块添加以下额外的行:

验证码:

1
2
3
4
5
6
compile"com.google.firebase:firebase-auth:$FOO"
compile"com.google.android.gms:play-services-auth:$FOO"

compile"com.android.support:design:$BAR"
compile"com.android.support:customtabs:$BAR"
compile"com.android.support:cardview-v7:$BAR"

然后,在您的情况下,您必须使用:

1
2
3
compile"com.android.support:design:26.1.0"
compile"com.android.support:customtabs:26.1.0"
compile"com.android.support:cardview-v7:26.1.0"

我遵循以下建议:

Suggestion: add 'tools:replace="android:value"' to element at
AndroidManifest.xml

因此,将此元数据添加到清单中可以解决我的问题:

1
2
3
4
<meta-data
    tools:replace="android:value"
    android:name="android.support.VERSION"
    android:value="26.1.0" />

enter image description here

1
compile 'com.firebaseui:firebase-ui-auth:2.3.0'

当您的FirebasuUi版本为2.3.0时,您的Firebase / Play服务版本必须为11.0.4

您的图书馆

1
2
3
4
5
//Add Library
compile 'com.android.support:design:26.1.0' //--->Same to your buildToolVersion
compile 'com.firebaseui:firebase-ui:0.2.0'  //--->2.3.0
compile 'com.google.android.gms:play-services-auth:11.2.2' //--->11.0.4
compile 'com.google.firebase:firebase-auth:11.2.2' //--->11.0.4

注意

到目前为止,最新的buildToolVersion是26.0.2。