Since I upgraded the project with the latest version of google services and libraries (9.0.0), I have this strange issue :
Grade console :
:
You need to add SHA certificate fingerprints to your project and then download the google-services.jason file again, which should contain "api_key": [{ "current_key": "xxxxxx" }] automatically.
You can view following page to see how to generate the fingerprints:
https://developers.google.com/android/guides/client-auth
On windows, just execute following command, and use android as password for debug purpose:
keytool -exportcert -list -v -alias androiddebugkey -keystore %USERPROFILE%\.android\debug.keystore
For firebase migrators:
make sure you have added at least one Fingerprint in your project settings and re-download the google-services.json file
Although Jozka Jozin's accepted answer and its comments, Cloud Messaging is neither related nor required.
Nevertheless, re-generating google-services.json
is the key to solution (so I voted him). Below is what I did:
As you know you can generate the config file for Analytics from the Google Developers Guide.
1: Choose your app.
2: Close the popup! It hides...
3: THE OPTION OF ADMOB!
4: Of course, select and enable it!
5: Now we can rightly generate configuration files!
6: We made it! This time, the configuration file should include the api_key appropriately.
Conclusion: The UI of the interactive generation tool is a bit confusing...
If you are using firebaes, you have to copy serverKey from the firebase to the google-services.json
"api_key": [{ "current_key": "SERVER_KEY"}
To get the server Key, Goto ProjectOverview> Project Settings > CloudMessaging > Copy OR generate and copy serverKey..
regenerate google-services.json at https://developers.google.com/cloud-messaging/android/client#get-config,one important thing is that you must enable Cloud Messaging in "Choose services" step ,open the new google-services.json file you will see words like
"api_key": [
{
"current_key": "xxxxxxxxxxx"
}"
without this words or without value of current_key is not the right file