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"
}
}
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'
Aside from the buildTypes section of build.gradle, what else should I do to make this work properly?
Android Product Flavors are used to create different app versions. App versions can be free or paid. They can have different themes and texts. They can use different environments or APIs. Let's assign two product flavors free and paid in our application.
The flavor dimensions define the cartesian product that will be used to produce variants. Example: flavorDimensions("dimA", "dimB") productFlavors { row1 { ... dimension = "dimA" } row2 { ... dimension = "dimA" } row3 { ... dimension = "dimA" } col1 { ...
A build type determines how an app is packaged. By default, the Android plug-in for Gradle supports two different types of builds: debug and release . Both can be configured inside the buildTypes block inside of the module build file.
Build variants are the result of Gradle using a specific set of rules to combine settings, code, and resources configured in your build types and product flavors. Although you do not configure build variants directly, you do configure the build types and product flavors that form them.
You need to provide a google-service.json for every build flavor. In your case you need a debug one.
Generate a new one with the new package name (the original package name + .debug). Then put the json into app/src/debug/.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With