Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generate google-services.json for Android

This might be a stupid question but I am facing an issue when trying to generate my google-services.json file for my app. I am following this guide from the google developers team to setup my project for analytics but when I click on the get configuration file button nothing happens, I just get a loading spinner that never ends.

I tried on different browsers, it's still the same. I checked the chrome console and got :

Refused to display 'https://accounts.google.com/ServiceLogin?service=cloudconsole&osid=1&passiv…3Dtrue%26cntlbl%3DContinue%2BAdding%2BAnalytics%26cntapi%3Danalytics&hl=en' in a frame because it set 'X-Frame-Options' to 'DENY'.

Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://console.developers.google.com') does not match the recipient window's origin ('null').

Any suggestion?

like image 731
alxscms Avatar asked Dec 21 '15 17:12

alxscms


People also ask

What is Google services JSON file in Android?

PLEASE NOTE: The google-services. json file is a different file to your Google Play Services API Key. The google-services. json file created in this doc is used within your app to connect to firebase and facilitate Android Push Notifications and is normally labelled google-services. json.

How can I add two Google services json in the same project?

There is no way to use two google-services. json files in a single Android app. The file name is the same between them and they need to be in the same location. So one will overwrite the other in that case.


2 Answers

You are trying this link while configuration https://developers.google.com/analytics/devguides/collection/android/v4/start

So please do the following steps enter image description here

Click on the GET A CONFIGURATION FILE

Now Choose your App Name.
enter image description here

Click Configuration Services After that the 3rd Window will be open

enter image description here

Now Choose your Analytics account of your Apps.

Hurry you have done.

Please use all the process and done as it is you can do it.

Let me know if still you have any problem.

like image 142
Kumar Vivek Avatar answered Oct 22 '22 10:10

Kumar Vivek


Well well, got a workaround. You console log helped: I clicked on the URL in the log ("https://accounts.google.com/ServiceLogin?service=cloudconsole&osid=1&passiv…3Dtrue%26cntlbl%3DContinue%2BAdding%2BAnalytics%26cntapi%3Danalytics&hl=en") and it led me to the right page and I have been able to generate a google-services.json for my app.

like image 39
Soumya Kanti Avatar answered Oct 22 '22 09:10

Soumya Kanti