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

Android Studio Bumblebee用Plugins DSL引入Google Play Services报UnknownPluginException

问题根因

com.google.gms.google-services插件未适配Gradle官方插件发布规范,没有以pluginId:pluginId.gradle.plugin:version的坐标格式上传至Google Maven仓库或Gradle插件中心,因此在settings.gradle的plugins块直接声明版本的方式无法解析到对应构件。

解决方案1(适配新版插件管理DSL,推荐)

修改settings.gradle配置如下:

pluginManagement {
    repositories {
        gradlePluginPortal()
        google()
        mavenCentral()
    }
    plugins {
        id 'com.android.application' version '7.1.0-alpha13'
        id 'com.android.library' version '7.1.0-alpha13'
        id 'org.jetbrains.kotlin.android' version '1.5.31'
        // 删除此处的com.google.gms.google-services版本声明
    }
    // 新增插件坐标映射规则
    resolutionStrategy {
        eachPlugin {
            if (requested.id.id == 'com.google.gms.google-services') {
                useModule("com.google.gms:google-services:4.3.10")
            }
        }
    }
}

应用级build.gradle的plugins块配置无需改动,保持原有声明即可。

解决方案2(传统classpath配置方式)

在根项目build.gradle顶部添加buildscript配置:

buildscript {
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath "com.google.gms:google-services:4.3.10"
    }
}
// 保留根项目原有其他配置

应用级build.gradle的plugins块配置无需改动。

注意事项

配置完成后需确认应用模块根目录已放置从Firebase控制台下载的google-services.json文件,否则插件执行阶段会抛出配置缺失错误。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.09.28 12:24:06