You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何解决google-services插件的版本冲突问题?

解决Google服务/Firebase版本冲突问题

这是典型的Google服务与Firebase依赖版本不匹配引发的冲突问题,给你两种可行的解决办法:

方案一:统一所有Firebase与Google服务依赖版本到11.8.0

你当前的依赖中,Firebase核心、数据库的版本是10.2.0,但广告相关的依赖版本是11.8.0,版本不一致就会触发冲突。把所有Firebase相关依赖统一升级到11.8.0即可解决:

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.firebaseui:firebase-ui-database:1.2.0'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    // 统一Firebase版本到11.8.0
    implementation 'com.google.firebase:firebase-core:11.8.0'
    implementation 'com.google.firebase:firebase-database:11.8.0'
    implementation 'com.google.android.gms:play-services-ads:11.8.0'
    implementation 'com.rengwuxian.materialedittext:library:2.1.4'
    implementation 'com.android.support:design:26.1.0'
    implementation 'com.android.support:appcompat-v7:26.+'
    implementation 'com.android.support:cardview-v7:26.+'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.android.support:support-v4:26'
    implementation 'com.google.firebase:firebase-ads:11.8.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:2.2.2'
}
apply plugin: 'com.google.gms.google-services'

方案二:更新google-services插件版本

如果你不想调整依赖版本,可以更新项目根目录下build.gradle文件中的com.google.gms.google-services插件版本,选择与你当前依赖版本兼容的最新插件版本即可。

内容的提问来源于stack exchange,提问作者TimaVlad VladTima

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 06:41:48