android manifest合并失败,gms播放服务/firebase [英] android manifest merger failed, gms play services / firebase
问题描述
我正在尝试使用firebaseUI将firebase添加到我的应用程序中. 如文档所述,我在firebaseUI版本中使用了对应的gms:play-services(11.0.4)( 2.2.0) 同步gradle文件时,出现以下错误:
I am trying to add firebase to my app using the firebaseUI. As the documentations says, I have used the corresponding gms:play-services (11.0.4) with the firebaseUI version (2.2.0) When I sync the gradle files, I receive following error:
Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute meta-data#android.support.VERSION@value value=(26.0.0) from [com.android.support:support-v13:26.0.0] AndroidManifest.xml:28:13-35
is also present at [com.android.support:customtabs:25.4.0] AndroidManifest.xml:25:13-35 value=(25.4.0).
Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:26:9-28:38 to override.
这是我的gradle文件:
This is my gradle file:
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.test.test"
minSdkVersion 21
targetSdkVersion 25
versionCode 1
versionName "1.0"
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:26.0.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:cardview-v7:26.0.0'
compile 'com.android.support:support-v13:26.0.0'
compile 'com.android.support:design:26.0.0'
compile 'com.android.support:recyclerview-v7:26.0.0'
//firebase
compile 'com.google.android.gms:play-services-auth:11.0.4'
compile 'com.google.firebase:firebase-core:11.0.4'
compile 'com.google.firebase:firebase-auth:11.0.4'
compile 'com.google.firebase:firebase-database:11.0.4'
compile 'com.google.firebase:firebase-storage:11.0.4'
compile 'com.firebaseui:firebase-ui:2.2.0'
testCompile 'junit:junit:4.12'
}
//firebase
apply plugin: 'com.google.gms.google-services'
我确保所有版本都是最新的,并且都相同.无法找出问题所在?
I've made sure that all the versions are up to date and that they are all the same. Can't figure out what the problem is?
推荐答案
我通过添加以下内容解决了该问题:
I solved the problem by adding:
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '26.0.0'
}
}
}
}
工具提示建议向元数据中添加tools:replace ="android:value"',但这会引发另一个错误,因此我将使用上述解决方案
The tooltip recommended adding tools:replace="android:value"' to meta-data but this throws another error, so im going with the solution above
这篇关于android manifest合并失败,gms播放服务/firebase的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!