Goal
I am developing an App that works with Google Fit, but for some reason I can't get them both versions to work at the same time.
Before recreating the credentials again, it was the other way around: Development was working and Production wasn't.
Credentials & Google Api
I enabled the Api and added the credentials:
KeyStore
The generated KetStore contains 2 keys, one for production and another one for development. Each one was set in the Credentials page accordingly to its package name (see Android App).
Android App
Our App has 2 different package names:
- xxx.yyy.app for Production
- xxx.yyy.development for Development
This was achieved with the Gradle config, using flavours. This way we have 2 Apps on the mobile for testing purposes.
Question
I have no idea what conflict it's happening that doesn't let me have them both working.
I only have 1 working at the same time, and the one that doesn't work gets CANCELLED result on the LogCat.
Maybe having the same package prefix (xxx.yyy.) is an issue and therefore, reads the wrong credential?
Any suggestions is appreciated. Thanks.
It turned out that
Android Studiowasn't using mykeystorewhen compiling theAPK. It was still using the defaultdebug.keystorewith aliasAndroidDebugKeyandandroidpassword.For some reason, it wasn't reading my signing config for the
developmentenvironment, but it was forproduction.In order to check what signing is each
Build Variantusing:Open a project
Open
Gradletab on the rightExpand <your_project> ==> Tasks ==> Android
Double click on
singingReport(this will create aGradletypeRun/Debug Configuration)Open
Gradle Consolelocated in the bottom rightAt this point you should see some of these:
Make sure the
SHA1for each variant is the same as the one specified in theCredentialspage.