Android:buildTypes applicationIdSuffix错误 [英] Android: buildTypes applicationIdSuffix error
问题描述
我想设置一个项目,以构建可以安装在同一设备上的两个不同的apk-其中一个是生产apk,第二个是调试apk.为此,我已经在build.gradle中定义了:
I want to setup a project to build two different apks that can be installed on the same device - one of them a production apk and the second one a debug apk. To do this I've defined in the build.gradle:
buildTypes {
release {
}
debug {
applicationIdSuffix = ".debug"
}
}
但是当我尝试同步gradle时出现错误:
but when I try to sync the gradle I get the error:
Error:org.gradle.api.GradleException: No matching client found for package name 'mypkg.debug'
除了build.gradle的buildTypes部分之外,我还应该做些什么才能使其正常工作?
Aside from the buildTypes section of build.gradle, what else should I do to make this work properly?
推荐答案
您需要为每种构建样式提供google-service.json.在您的情况下,您需要一个调试工具.
You need to provide a google-service.json for every build flavor. In your case you need a debug one.
使用新的程序包名称(原始程序包名称+ .debug)生成一个新的程序包.然后将json放入 app/src/debug/.
Generate a new one with the new package name (the original package name + .debug). Then put the json into app/src/debug/.
这篇关于Android:buildTypes applicationIdSuffix错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!