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

添加Firebase Messenger后出现Google Services插件版本冲突求助

Hey there, let's get that Firebase version conflict sorted out for you!

What's causing the issue?

The error message is pointing out a mismatch between your google-services plugin version and the Firebase dependencies you're using. Your project is running com.google.gms:google-services:3.2.1 (a relatively old version) alongside Firebase libraries at version 11.8.0—these two don't play nicely together. The plugin needs an update to support the newer Firebase versions.

How to fix it

Here's the step-by-step solution:

  1. Update the google-services plugin in your project-level build.gradle
    Open your top-level build.gradle file and replace the old plugin version with one compatible with Firebase 11.8.0. A safe, fully compatible choice here is version 4.3.10:

    buildscript {
        repositories {
            jcenter()
            google()
            maven { url 'https://maven.fabric.io/public' }
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.1.2'
            classpath 'com.google.gms:google-services:4.3.10' // Updated this line
            classpath 'io.fabric.tools:gradle:1.25.1'
            classpath 'com.google.firebase:firebase-plugins:1.1.5'
        }
    }
    
  2. Double-check your Firebase dependency consistency
    Great news—you already have all your Firebase libraries set to 11.8.0, which is perfect. Keeping all Firebase/Google Play Services dependencies on the same version is critical to avoid these conflicts, so no changes needed here.

  3. Confirm plugin placement
    You already have apply plugin: 'com.google.gms.google-services' at the very bottom of your app-level build.gradle, which is the correct position (it needs to come after all your dependencies are declared). No adjustments required here either!

Final steps

After making these changes, sync your Gradle project and rebuild it. The version conflict error should disappear.

If you run into similar issues later, remember: the google-services plugin version must match the compatibility of your Firebase/Google Play Services libraries. Updating the plugin is almost always better than downgrading Firebase libraries (since you’ll keep access to new features and bug fixes).

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.28 07:13:48