Not finding google-services.json


#1

Hello!

When i try to build my android app it results in the following:

Error: /home/jorge/Documents/Bitbucket/blunder-ionic/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':processDebugGoogleServices'.
> File google-services.json is missing. The Google Services Plugin cannot function without it. 
   Searched Location: 
  /home/jorge/Documents/Bitbucket/blunder-ionic/platforms/android/src/debug/google-services.json
  /home/jorge/Documents/Bitbucket/blunder-ionic/platforms/android/google-services.json

I have been reading posts about it in the forum and some people say that it is as easy as adding the file in the locations it is requesting but as the contents of the folder “platforms” are created dynamically i don’t want to add in by hand each time i add the different platforms.

I am new to ionic so if you need any part of any file, please tell me.

Thanks in advance!


#2

Are you using Firebase Push with your app ? make sure your project have google-services.json at \platforms\android


#3

I documented my migration to phonegap-plugin-push there, have a look, I explain how to get google-services.json and how to write a hook to copy the file on each build


#4

Hi again guys, just found out why it started to need the google-services.json.

It is because of the phonegap version as @reedrichards wrote it is needed since version 2.0.0 and i am using a lower version now.

Thank you for all the answers!


#5

how did you fix this? @blunder


#6

Step 1) Put google-services.josn file in root of project.

Step 2) In config.xml add following line:
<resource-file src="google-services.json" target="app/google-services.json" />

Now remove platform and re add platform. it will copy google-service.json file in android project and work fine.