Is there another place to get a google-services.json?

后端 未结 4 1280
礼貌的吻别
礼貌的吻别 2020-12-01 07:41

I tried clicking the GET A CONFIGURATION FILE link from the docs, but the resulting page just loads and loads. This happens in Firefox and Chrome and on my pho

相关标签:
4条回答
  • 2020-12-01 07:56

    Referring to this page:

    The Firebase console will help you download the google-services.json. In addition, the Quickstart guides for most APIs have instructions for generating this file. Once you have downloaded the google-services.json file, copy it into the app/ folder of your Android Studio project, or into the app/src/{build_type} folder if you are using multiple build types.

    So go to Firebase Console, press add new project and follow instructions

    0 讨论(0)
  • 2020-12-01 08:05

    OK, I've found a workaround if anyone else is having this problem.

    Based on the error message about being unable to display https://accounts.google.com/ServiceLogin?service=cloudconsole&osid=1&passiv…ed%253Dtrue%26cntlbl%3DContinue%2BAdding%2BSign-In%26cntapi%3Dsignin&hl=en in a frame... I just followed that link directly.

    EDIT: None of the other links were working for me. If you came searching for the console errors Refused to display..., this is the answer for you. This bug seems to have been fixed for the google-services.json, so if you're just looking for the link, the highest-rated answer is the one you want.

    0 讨论(0)
  • 2020-12-01 08:16

    This might be a temporary issue due to network connectivity or something like that.

    One solution would be to try again at a later point in time. This might be happening because you're trying to download the google-services.json for the sample project (com.google.samples.quickstart.signin).

    If you want result now, you could follow the steps to integrate the Google Sign In into your app.

    1. Create a new empty android studio project/if you have an existing project skip this step.
    2. Use this link and follow the onscreen instructions to generate the google-services.json for your app.

    1. The app name here refers to your project name in Google Developers Console. If you've already setup your Google developers console project for your android app, you can select that via the drop-down menu. If you have not created one, just enter a name and that project will be created for you in your developers console.

    2. Select the google services you need for your project viz Google Sign
      In, Google Cloud Messaging, AdMob etc. In our case, we just selected Google Sign In.

    3. You will be asked for SHA-1 hash. Follow these steps to get one.

    4. Click on generate configuration files. Next screen you will be presented with an option to download google-services.json for your app. Download that and you're good to go.

    1. Once you have the google-services.json, follow these steps to complete the Google Sign In.

    References

    1. Start Integrating Google Sign-In into Your Android App,
    2. Integrating Google Sign-In into Your Android App.
    0 讨论(0)
  • 2020-12-01 08:17

    You will get "google-services.json" as soon as you create a Firebase project.

    But, in case you missed and forgot to download that, you can still get the JSON file from the existing project-

    • Just select the project from firebase console.
    • Head over to project settings
    • scroll down (Yeah!, there it is!)

    Screenshot :

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