24

I was practicing firebase CodeLab (Friendly Chat) for learning firebase with android. In that tutorials ,I made a project on firebase console named as "Friendly Chat" and then I add my android app package name and SHA-1 so that invites and Google Auth could be work. After that tutorial get compeleted, I got firebase Auth demo project from github.I add auth demo project's package name and SHA-1 in same console project "Friendly Chat",its mean now console project "Friendly Chat" have two android apps.Then I downlaoded google.services.json file of Auth project and when I run project in Android Studio,Auth demo did not work as it keep showing loading progress Dialog.I thought it may be because I added two android apps in same console project so,I delete auth app from Friendly Chat console project and made another project on firebase console named as "Project Auth" and I add package name of Auth demo android project (which I downloaded from firebase github repository) but when I tried to add SHA-1 copied from "Friendly Chat" console project,it gives me below error

"An OAuth2 client already exists for this package name and SHA-1 in another project"

why Im getting this error even I have deleted Auth app package name and SHA-1 from other console project.

Zaid Mirza
  • 3,540
  • 2
  • 24
  • 40

1 Answers1

56

So the answer is well written in the error. You can't have two projects of same package name. Even if you delete it. It will take alteast 4-5 days to get deleted fully from developer's console.

So only solution is to generate a new SHA-1 key by custom signing the app by generating a signed apk from 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.

EDIT: I encourage you to go through these official Google docs on signing apk to understand this process.

Nishant Dubey
  • 2,802
  • 1
  • 13
  • 18
  • I dont really know about SHA-1, I generate it using keytools programe of my installed JDK.can you guide me about this? – Zaid Mirza Oct 01 '16 at 14:57
  • 1
    @ZaidMirza please read the link in edited answer. After you follow it to sign your apk you can use same keytools to point to this new keystore file and get new sha1 key and update your firebase project – Nishant Dubey Oct 01 '16 at 15:04
  • I uses this command to get SHA-1 `keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore -list -v -storepass android` – Zaid Mirza Oct 01 '16 at 15:04
  • Yes this right. But after you sign the apk you will get new custom **newname.keystore** file .. So all you need to do is run this same command in that file instead of debug.keystore please follow the link I suggested – Nishant Dubey Oct 01 '16 at 15:08
  • Thanks , tell me last think please, is SHA-1 which I generate can be conflict with other apps on Google Play store when I will upload it? – Zaid Mirza Oct 01 '16 at 16:55
  • No, it's a unique identity for a unique package name. One package can have only one SHA-1 key it's like your fingerprint. – Nishant Dubey Oct 01 '16 at 16:57
  • @ZaidMirza if my answer helped you then please do consider upvoting and accepting it :) . Good luck – Nishant Dubey Oct 01 '16 at 16:58
  • I know package name must be unique to deployed on App store, but when I generate SHA-1 using keytools as you suggested,at that time there is not concern about package name, SHA generates key independant of package name at that time, so what I got it is that package name already unique on Play Store/App Store but SHA-1 joins pakcage name with a kind of `AND` logical operator and make our app unique and SHA-1 help users to sign in with Google credentials – Zaid Mirza Oct 01 '16 at 17:23
  • Now your issue is solved right ? – Nishant Dubey Oct 01 '16 at 17:24
  • yes it is resolved.Thanks I was confirming my concept in last comment – Zaid Mirza Oct 02 '16 at 03:01
  • 1
    i already uploaded my app in play store now how can i update sha1 finger print – R.Anandan Nov 14 '17 at 06:30
  • 4
    I had contacted Firebase support and they suggested me to remove the useless credential which was lying around preventing me to add in new project. I had to go to google cloud console and remove the credential from API section. – Vijay Kumar Kanta Dec 01 '18 at 13:13
  • 4
    Can you give us official sources that say that it takes several days to fully remove the ID client ? – Ana Koridze Sep 29 '19 at 09:37
  • follow same link https://stackoverflow.com/a/60204749/4997704 – Binesh Kumar Feb 13 '20 at 09:44
  • so I did this. generated a new sha, even added the sha1 and 256 to firebase and I still get the error. now i'm aware theres a debug and a release sha (i even think theres an apk one) but when i fetch it from the keystore it only returns 1. am I doing something wrong? – raiton Jul 02 '20 at 00:33
  • 1
    I work on 2 apps with different package names and I still see this issue, as both of them have the same SHA1 value. How come? – android developer Dec 20 '20 at 14:03