Some time ago I created an example project (lets call it "example project") with Oauth2 client id
for android application in Google APIs console. I also added SHA1 fingerprint
and package name (for example com.package.name).
My mistake was that an application with same package name already existed. Now I need to create an Oauth2 client id
for android application in the "valid project" with package name com.package.name
and with SHA1 fingerprint
which I added before. Obviously when I tried to add this fingerprint I got an error.
The signing fingerprint you specified is already used by another Android OAuth2 client.
After that I remembered about "example project" and deleted client id
from this project. The problem is that I still not able to add this fingerprint for package name com.package.name
. Client id
is deleted but still I have the same error as above.
So do I have a possibility to use this fingerprint for the same package name in another project?
I'll note that this if your app is listed in the play store, you probably don't want to change the package name and you probably don't want to replace the production key (as you'll be forced to make a new listing).
If you're absolutely sure that there are no currently active projects making use of the current package-name/fingerprint pair, one final thing to try: Make a completely new credential. You'll have to replace your credential file in the application.
I didn't expect this to help, but it did. Maybe Google is somehow caching the lookup? "This packagename/fingerprint/clientID lookup is a duplicate, so don't bother looking it up again."
If you are using each firebase project for each env as I am, the below approach might be helpful.
In your build gradle, create new application id for each env:
On each firebase project, add a new project with corresponding application id with the same finger print. Remember to download the new google service json file since the application id was changed. The package name remains the same so it would not be a problem when uploading into google play. But for sure, I leave the prod flavor empty, so the package name and application id will be the same for prod release to avoid trouble.
This error occurs when there is an existing
SIGNING CERTIFICATE FINGERPRINT (SHA1)
on Google Developers linked to a different account.Solution is to delete the project that is using that
SHA1
inconsole.developers.google.com
for the old/incorrect project.You cannot change the SHA1 fingerprint once it is set. Remember that deleting the project takes 7 days to completely remove it.
Another option is to delete the
debug.keystore
and generate a new one with:Remember you have to uninstall the app otherwise you get the
[INSTALL_FAILED_UPDATE_INCOMPATIBLE]
error.Ran into this issue today. As the project takes a long time to get completely deleted, the easiest way is to create a new SHA1 by simply deleting the local debug.keystore. It get's auto generated when you run any app after deleting it. This is documented in the Android docs here.
As someone could wanna use the same application through two or more firebase projects for many reasons and so get this error I here do address this particular scenario. The esiest way to run the same application upon two or more different firebase projects (let’s say production and staging) is to add to your Module level
build.gradle
file a build variant (let's say staging) like this one:In the build variant
staging
what's most important is the line:This will inject at build time a ".staging" suffix to your application ID so that you will automatically have
You than need to add this application (
"com.mydomain.myapp.staging"
) to your firebase staging project and so you will be able to add the same"com.mydomain.myapp"
SHA1 to this application, because it has a different application ID.