Missing api_key/current key with Google Services 3.0.0

后端 未结 17 940
小鲜肉
小鲜肉 2020-12-02 07:20

Since I upgraded the project with the latest version of google services and libraries (9.0.0), I have this strange issue :

Grade console :

:         


        
17条回答
  •  情深已故
    2020-12-02 07:58

    Using Firebase

    GoogleServices'. > Missing api_key/current_key object
    

    I got this error after updating an existing project to the new Firebase Services. The generated google-service.json file downloaded from the firebase project settings page did not include the api_key needed.

    From the other answers here it looks like Google/Firebase Cloud Messaging (GCM/FCM) needs to be added for this api_key to be included in the google-service.json file.

    So I added a dependencies on the firebase FCM before downloading the file again, and this time the key was included.

    Include FCM (GCM)

    dependencies {
         compile 'com.google.firebase:firebase-messaging:9.0.0'
    }
    

提交回复
热议问题