SHA 1 Hash key is same for all application? - android

I have integrated Google login in my Android application before one month. Now I am planning to launch another application with different package name. I am trying to implement Google login in this application too.
When I have generated and pasted SHA 1 to google and its giving error like below
Duplicate fingerprint
The fingerprint you specified is already used by an Android OAuth2 client ID in this project or another project
I want know that SHA 1 is same for all project in same machine even We change package name in application ?
What is solution for use Google login in another application ? I am confused because Google ask package name with Google Auth. I have marked that in new package also Google signin working fine but it will cause issue in future ?

Every app has a different SHA key fingerprint. You need to update it for every project that you make.
For Example: If I am updating my app and I create a new project, ill have to add another SHA key to the firebase project under the settings of the app in firebase.

Related

Question on Firebase Authentication SHA1 for Android [duplicate]

My local android app is synced up in google firebase console with my SHA key configured in google.services.json. How do the developer on other end
can setup the project to use the same firebase console and json file.
We are trying phone based authentication. While setup at my end works is fine, but the developer on the other end is getting this error - This operation is not allowed. You must enable this service in the console.
Please help me with the correct way to do this.
Solution:
So for other developers, generate the SHA-1 Key as described in the picture
Go to Firebase Console:
Settings
Your Apps
Add Fingerprint and paste the SHA.
A solution for the comment:
So the answer is well written in the error. You can't have two projects of the same package name. Even if you delete it. It will take a least 4-5 days to get deleted fully from the developer's console.
So the only solution is to generate a new SHA-1 key by custom signing the app by generating a signed apk from the android studio. Or just create a new project with different package name both ways will work for now.
Hope this info helps. Do let me know if it changes anything for you.
Adding to Sharan's answer, that is the correct one, you can add those SHA1 keys in your Firebase console going to
Project configuration - ADD FINGERPRINT
Remember to select the correct project at the Android apps panel in order to add those keys

Multiple Android App in single Google Firestore Project

I presently work on Firestore project in Android. The project works perfectly. Now I want to create another android app for the same Firestore project. This is a helping tool for the main app.
But here I try to add another app to Firestore it displays error the same SHA key is used.
Now how to rectify this problem?
If you want to add another app to a Firebase project, you need to do at least one of two things:
Give the app a new application ID
Sign the app with a different signing key (different SHA-1)
If you want to use the same signing key for the second app, then you will have to give the app a different application ID than the first.

How multiple developers can work on the same android app connected to a single Firebase console?

My local android app is synced up in google firebase console with my SHA key configured in google.services.json. How do the developer on other end
can setup the project to use the same firebase console and json file.
We are trying phone based authentication. While setup at my end works is fine, but the developer on the other end is getting this error - This operation is not allowed. You must enable this service in the console.
Please help me with the correct way to do this.
Solution:
So for other developers, generate the SHA-1 Key as described in the picture
Go to Firebase Console:
Settings
Your Apps
Add Fingerprint and paste the SHA.
A solution for the comment:
So the answer is well written in the error. You can't have two projects of the same package name. Even if you delete it. It will take a least 4-5 days to get deleted fully from the developer's console.
So the only solution is to generate a new SHA-1 key by custom signing the app by generating a signed apk from the android studio. Or just create a new project with different package name both ways will work for now.
Hope this info helps. Do let me know if it changes anything for you.
Adding to Sharan's answer, that is the correct one, you can add those SHA1 keys in your Firebase console going to
Project configuration - ADD FINGERPRINT
Remember to select the correct project at the Android apps panel in order to add those keys

Getting duplicate fingerprint error while updating SHA-1 fingerprint for Android oAuth2 Client ID

Just a few days ago I have changed my SHA-1 fingerprint (from signing to dev) for testing purpose. Now I want to go back to signing SHA-1 but it's not allowing me to add live SHA-1 fingerprint. It gives me duplicate fingerprint error.
I am sure that we do not have any other client id already registered with the app's fingerprint. We don't have any deleted project as well. My app is already in the Store I can't simply change the package or the keystore to make it work.
While updating SHA-1 fingerprint in the Google Cloud Platform developer console, I get the following popup:
Duplicate fingerprint
The fingerprint you specified is already used by an Android OAuth2 client ID in this project or another project
Anyone with a similar problem that managed to reach a solution?
You have to go to your API console and undelete your old project that contains the OAuth ID that you are trying to use for your new project.
One of the previous projects that I had already deleted still contained it.
You couldn't add the new OAuth because it "already existed" even though your project did not contain that ID already.
When you delete a project in the API console, the OAuth IDs associated with it seem to not get deleted with it.
This should really be changed!
I found a fix to this problem.
When the console asks you for the SHA1 and Package name for a new API that you are using in the same app.
Just keep the same SHA1 code and change the Package name a little.
Eg: com.example.exampleapp to com.example.exampleapp1 .
I know this is not a full proof solution but i have many different google API calls in my app by just changing the package name a little.
I tried many solution from This but my simple fix helped me move on.
Hope this helps you.

Google Maps Android API Authorization Failure when reusing api access key in android

I created one application and generated an api key, which worked and my app correctly renders map.
I created a second application, which is based on an Android Library project I created and I want to reuse the API_KEY of the first app. In https://code.google.com/apis/console, for my API debug project, I selected "Edit allowed Android apps...".
Then on a new line, I added the SHA1 certificate fingerprint and package name (separated by a semicolon) of my second project. So now that API Access key has the fingerprints of two apps associated with it.
However, when I test the second app on my android phone, logcat outputs
Google Maps Android API Authorization Failure.
The Certificate fingerprint of my second app is correct. My second app also references Google Play Services and is using Google API Level 16.
The second app manifest file is set up similarly to the first one, making reference to the debug API_KEY and having the same android permissions. What may I be doing wrong?
However, the recommended practice is to sign each of your applications with a different certificate and get a different key for each one.
https://developers.google.com/maps/documentation/android/start#getting_the_google_maps_android_api_v2
:D
I've previously found this helpful https://stackoverflow.com/a/13865113/935779
Make sure to export a signed copy with the same key you used to create your API key
This is often a problem when working with a Google Maps key and may very well be your issue. However, Nathvi is also correct from the documentation and you may consider a separate key if at all possible.

Categories

Resources