Gradle build fails with Google Service Plugin 3.2.0

时光怂恿深爱的人放手 提交于 2019-12-21 09:03:05

问题


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

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'

the error occurs.

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?


回答1:


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"
    }
}

Reported : https://issuetracker.google.com/issues/72581499



来源:https://stackoverflow.com/questions/48522688/gradle-build-fails-with-google-service-plugin-3-2-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!