Cannot resolve symbol default_web_client_id in Firebase's Android Codelab

前端 未结 19 1358
说谎
说谎 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条回答
  •  日久生厌
    2021-02-01 06:22

    I know it is late to answer but hope this will help someone in the future.

    To access there is no need to hard code default_web_client_id in app.

    To access default_web_client_id in Android App from google-services.json, we have to add SHA1 key under FireBase project Settings.

    Go to Firebase Console > Open Project > Select App > Add Fingerprint.

    After this copy generated google-services.json to project.

    After this you will see the difference in json file as below:

    Before :

    "oauth_client": []
    

    After :

    "oauth_client": [
        {
          "client_id": "23........4-asdj...........................asda.googleusercontent.com",
          "client_type": 1,
          "android_info": {
            "package_name": "com.abc.xyz",
            "certificate_hash": "asjhdashhs"
          }
        },.....
    

    This will solve your issue.

提交回复
热议问题