google-services.json" was found, but it indicates a project ID that you don't appear to have access to

后端 未结 7 1502
暖寄归人
暖寄归人 2021-02-19 07:04

In Firebase Option Android Studio when I click on \"connect to firebase\" I am getting the following error.

\"google-services.json\" was found, but it ind

相关标签:
7条回答
  • 2021-02-19 07:06

    \appname\.idea\modules\app\google-services.json Delete this file in your project folder first.

    In my case, I already had this file in my project files as I changed my package name, and I was trying the add the google-services.json file for the second time. And I was getting this error: -

    > A config file "something\google-services.json" was found, but it
    > indicates a project ID that you dont appear to have access to. Request
    > access or delete the file in order to proceed with the connection
    > process.
    
    0 讨论(0)
  • 2021-02-19 07:08

    For me, I had to navigate to the web console:

    https://console.firebase.google.com/u/0/

    and add my app as a project manually:

    After clicking "ADD FIREBASE" it worked.

    0 讨论(0)
  • 2021-02-19 07:09

    For me, the problem was that I had a wrong "google-service.json" file in my project.
    (I signed in to Android Studio & Firebase Console)

    If you are like me, you need this.

    ① delete all "google-service" file. You can easily find it by [Ctrl + shift + n] and put the file name in.

    ② Go to Firebase Console → Setting → App setting → app card below, now you can find  "goole-service.json" file that is customized for your project. Download it.

    ③ Copy the new file and paste it in your Project. (Project → app → here!!!)

    ④ Go to Firebase assistant and click "connect to Firebase"

    0 讨论(0)
  • 2021-02-19 07:17

    In my case my URL of my main activity was different from that of my googleServices.json file. I will advise you to just copy from your googleServices.json file and paste in your MainActivity.java (Make sure both URLs are exactly the same).

    0 讨论(0)
  • 2021-02-19 07:26

    Reason:

    • if you are signed in to Android Studio and the Firebase Console with different accounts
    • Or your JSON file is corrupted

    Solution :

    • Use same account for Studio and console.

    • Delete the corrupted JSON and use Studio plugin to create the project, it will automatically handle the corner cases

    0 讨论(0)
  • 2021-02-19 07:29

    This error will occur if you are signed in to Android Studio and the Firebase Console with different accounts.

    In Android Studio, click on the small profile icon in the upper right corner to see your sign-in account. Do the same for the Firebase Console tab of your browser. If they are different, sign out and sign in to make them the same.

    0 讨论(0)
提交回复
热议问题