0

My application uses GCM since a very long time. Since the old API is deprecated, I am trying to upgrade it and use google-services-gcm.

I followed the suggested steps on the google website however, I got the following error:

Execution failed for task ':mylib:processReleaseGoogleServices'.

File google-services.json is missing from module root folder. The Google Services Plugin cannot function without it.

I already have my app configured to use GCM but previously we didn't need such a file. Do I need to generate a new one for my app?

lyc001
  • 777
  • 1
  • 10
  • 25

1 Answers1

1

Yes, that's now the right way to do it.

The gradle plugin will generate the XML files for you when building it and put it in the correct build/ folders.

zmarkan
  • 605
  • 5
  • 13
  • But is it only to be able to use: `getString( R.string.gcm_defaultSenderId);` ? Can't you just store the senderId in a string and use that and remove the com.google.gms.google-services plugin from the gradle file, or will something else break? – Peter Dec 03 '15 at 14:38
  • If it doesn't break, it's going against the framework. The approach suggested on the dev docs site is supported - anything else is not. – zmarkan Dec 03 '15 at 14:40
  • @zmarkan I tried to generate the config file and they gave me a new Server API Key and Server ID. The problem is I already have these values set on the server and users using version of the app with the deprecated GCM API. Do I need to update these values on the server? and then what happens to the users who have registered to GCM with the old configurations? – lyc001 Dec 03 '15 at 14:51
  • Not sure about that, sorry! – zmarkan Dec 03 '15 at 16:09
  • You can generate a google-services.json file for an existing project. Enter the current project name, and you should be able to download a config file for your current project, with existing sender ID. https://developers.google.com/mobile/add?platform=android&cntapi=gcm – Arthur Thompson Dec 04 '15 at 16:32