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

请求解决Google-services插件版本冲突问题(附App依赖配置)

Fixing Google Services Plugin Version Conflict

Hey there, let's get that version conflict sorted out! The error you're seeing almost always happens when the version of the google-services plugin (set in your project-level build.gradle) doesn't match up with the versions of Firebase or Google Play Services dependencies you're using in your app module.

Here's a step-by-step fix:

Step 1: Check your project-level build.gradle

First, open your root build.gradle file (not the one inside the app folder). Look for the buildscript block—this is where the google-services plugin version is defined. It’ll look something like this:

buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1' // Your gradle plugin version
        classpath 'com.google.gms:google-services:4.2.0' // This is the line we care about
    }
}

Step 2: Update the google-services plugin version

The error message tells you to update this plugin, so let’s pick a version compatible with your current setup. Since you’re using Android Support Library v27.1.1, you’ll want a plugin version that doesn’t require AndroidX (unless you’re ready to migrate). A safe bet is 4.3.10—it’s stable and works well with Support Library v27. Update that line to:

classpath 'com.google.gms:google-services:4.3.10'

Step 3: Align your Firebase dependencies

Now head back to your app-level build.gradle. Your Firebase dependency was cut off (com.google.firebase:fire...), so make sure whatever Firebase service you’re using (Firestore, Auth, etc.) has a version compatible with the plugin you just updated. For example, if it’s Firestore, use:

implementation 'com.google.firebase:firebase-firestore:17.1.5'

All Firebase/Google Play Services dependencies should use versions that match the plugin’s supported range—stick to versions released around the same time as the plugin to avoid conflicts.

Step 4: Sync and clean your project

After making these changes, click "Sync Now" in Android Studio. If you still run into issues, try cleaning your project (Build > Clean Project) then rebuilding it (Build > Rebuild Project) to clear any cached files.

Optional: Migrate to AndroidX (for long-term fixes)

If you’re open to a bigger change, migrating to AndroidX will let you use the latest versions of the google-services plugin and Firebase dependencies (since Google no longer updates the old Support Libraries). But that requires updating all your Support Library references to AndroidX equivalents—only do this if you’re ready for a full migration.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.25 07:24:40