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

求助解决Gradle版本冲突:gms.google.services与firebase-storage:11.8.0不兼容

解决Firebase版本冲突导致的processDebugGoogleServices失败问题

这种版本冲突问题真的很头疼,我之前整合Firebase多个服务时也踩过完全一样的坑!给你几个肯定能解决的步骤:

  • 统一所有Firebase/Google Play服务依赖版本
    Google要求所有com.google.android.gms和com.google.firebase开头的依赖必须使用完全相同的版本号,不能混合不同版本。你之前用Firestore正常,添加Storage后版本不匹配才触发了冲突。
    打开app模块的build.gradle,把所有Firebase相关依赖的版本统一为11.8.0(或者你想使用的稳定版本):

    // 示例:统一所有Firebase依赖版本
    implementation 'com.google.firebase:firebase-firestore:11.8.0'
    implementation 'com.google.firebase:firebase-storage:11.8.0'
    // 如果还有其他Firebase服务(如Auth、Analytics),也同步版本
    
  • 更新google-services插件版本
    项目根目录的build.gradle里的google-services插件版本必须和Firebase依赖版本兼容。把插件更新到对应最新稳定版:

    buildscript {
        repositories {
            google()
            jcenter()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.2.1' // 对应你的Gradle版本
            classpath 'com.google.gms:google-services:4.0.1' // 适配11.8.0的插件版本,可换成最新稳定版
        }
    }
    
  • 清理缓存并重建项目
    有时候Android Studio的缓存会残留旧版本信息,导致冲突无法解决:

    1. 点击菜单栏 File > Invalidate Caches / Restart,选择Invalidate and Restart重启IDE
    2. 重启后执行 Build > Clean Project,再执行 Build > Rebuild Project
  • 排查第三方库的依赖冲突
    如果以上步骤都没用,可能是某个第三方依赖偷偷引入了不同版本的Google Play服务。你可以通过命令行查看依赖树:

    ./gradlew app:dependencies
    

    找到冲突的依赖后,在引入第三方库时排除旧版本的Google服务:

    implementation('第三方库的依赖地址') {
        exclude group: 'com.google.android.gms'
        exclude group: 'com.google.firebase'
    }
    

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.19 08:41:01