Gradle 构建失败,使用 Google Service Plugin 3.2.0 [英] Gradle build fails with Google Service Plugin 3.2.0

查看:31
本文介绍了Gradle 构建失败,使用 Google Service Plugin 3.2.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试更新 Google 服务插件,但在 Gradle 同步期间收到错误消息:项目刷新失败:错误:找不到匹配项"

I am attempting to update Google Services Plugin but receive an error during Gradle sync: "Project Refresh Failed: Error: No Match Found"

在 3.1.1 版中一切正常,但是一旦我将 build.gradle 更新为:

Everything works fine with Version 3.1.1 but as soon as I update the build.gradle to:

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

出现错误.

我按照提示的错误检查了idea.log,可以看到正在抛出异常,但我真的不知道为什么.它似乎被抛出一个名为getJsonLocations"的方法,该方法似乎是 3.2.0 中的新方法,如下图所示.

I checked the idea.log as the error suggested and can see that an exception is being thrown but I really do not know why. It seems to get thrown at a method named "getJsonLocations" which seems to be new in 3.2.0 as shown in the image below.

有人知道如何解决这个问题吗?

Would anybody know how to resolve this?

推荐答案

看来 productFlavors 现在必须以小写字母开头才能使该插件工作.使用大写字母会引发问题中显示的异常.

It seems that productFlavours must now start with a lower case letter for this plugin to work. Using a capital letter throws the exception shown in the question.

我没有看到此限制记录.

I do not see this limitation documented.

productFlavors {

    // Works fine
    notDemo {
        applicationIdSuffix ".notDemo"
        versionNameSuffix "-notDemo"
    }

    // Not valid because it starts with a capital letter
    Demo {
        applicationIdSuffix ".demo"
        versionNameSuffix "-demo"
    }
}

报告:https://issuetracker.google.com/issues/72581499

这篇关于Gradle 构建失败,使用 Google Service Plugin 3.2.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆