Cannot resolve symbol default_web_client_id in Firebase's Android Codelab

前端 未结 19 1693
说谎
说谎 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 05:59

    A more generic solution would be to add the google-services.json into the app's root directory.
    And add

    apply plugin: 'com.google.gms.google-services at the end of build.gradle file.

    Explanation

    When the app builds the key value pair strings from google-services.json config file are then placed into the values.xml file to make them globally available for use from anywhere in your code. This saves us from hard coding the client_id in your code.

    Note

    Do not add the default_web_client_id with client_id as its value in the strings.xml in order to avoid the error of duplication, Error: Duplicate resourceslater on when you run your code.

提交回复
热议问题