Cannot resolve symbol default_web_client_id in Firebase's Android Codelab

前端 未结 19 1398
说谎
说谎 2021-02-01 05:18

I am trying to learn Firebase, so I went through the Android Codelab. The project they gave me however, had an error:

Cannot resolve symbol default_web_cl

19条回答
  •  猫巷女王i
    2021-02-01 06:11

    Download your newest google-services.json. List of client_id is present for OAuth 2.0 client IDs in your Google Cloud Credentials.

    Then check whether it contains client_id with "client_type" : 3 or not. If not, you need to create a new one:

    1. Open the Credentials page in the API Console.
    2. Click Create credentials -> OAuth cliend ID. Then chose type Web application.
    3. Wait 2-3 minutes, refresh Firebase Console & download your google-services.json again. It should contain client_id with "client_type" : 3 now.

    Clean & rebuild your project to apply new API config.


    The client_id with "client_type" : 3 is usually inside oauth_client tag, not services or other_platform_oauth_client.

    If you fall to this case & cannot build the project, try copy your client_id to oauth_client tag and rebuild again.

    "client": [
            ...
            "oauth_client": [
                ...
                {
                  "client_id": "YOUR WEB CLIENT ID",
                  "client_type": 3
                }
            ]
    ]     
    

提交回复
热议问题