M
M
mr_serg772017-09-21 01:14:06
Android
mr_serg77, 2017-09-21 01:14:06

How to correctly get different package names when compiling Gradle?

Actually, there was a need to have two different package names (debug \ release).
GAPS, Firebase and other features are connected in the application (if necessary, I will clarify what exactly is there).
I never thought that it could turn into a headache, but still.
The solution that I found, and it seemed to me more than elegant:

buildTypes {
        release {
            debuggable false
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        debug {
            applicationIdSuffix '.debug'// вот это добавилось
            versionNameSuffix '-DEBUG'// и это добавилось
            debuggable true
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

I am getting an error:
Error:Execution failed for task ':app:processDebugGoogleServices'.
> No matching client found for package name '**.******.********.debug'

How to correctly split into two versions?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey, 2017-09-21
@mr_serg77

Did you forget to add a block for the debug version to google-services.json?
"client_info": {
"mobilesdk_app_id": "la-la-la-la",
"android_client_info": {
"package_name": "your.package.app.debug"
}
}
......

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question