问题
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?
回答1:
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.
回答2:
You are trying this link while configuration https://developers.google.com/analytics/devguides/collection/android/v4/start
So please do the following steps
Click on the GET A CONFIGURATION FILE
Now Choose your App Name.
Click Configuration Services After that the 3rd Window will be open
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.
回答3:
A guy from Google analytics team suggests the solution here.
回答4:
Try going through this website to get your configuration file - its the one for Cloud Messaging but it has a button that says "GET CONFIGURATION FILE":
https://developers.google.com/cloud-messaging/android/client
Also I did experience the same problem last week sometime when configurating cloud messaging myself but it seemed to have resolved itself in the afternoon so it could just be a one day error thing.
回答5:
Steps for getting configuration if your first time login to google developer account.
- open google developer console.
- login to developer console.
- create project with valid name.
- then goto the API section & enable GCM API.
- Then get the configuration file.
来源:https://stackoverflow.com/questions/34401143/generate-google-services-json-for-android