androidandroid-gradle-pluginbuild.gradleandroid-build-typeandroid-gradle-2.0

Android: buildTypes applicationIdSuffix error


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?


Solution

  • 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/.