为Android生成google-services.json

alx*_*cms 9 android google-analytics

这可能是一个愚蠢的问题,但我在尝试google-services.json为我的应用程序生成文件时遇到问题.我正在关注谷歌开发团队的这个指南来设置我的分析项目,但是当我点击获取配置文件按钮时没有任何反应,我只是得到一个永不停止的加载微调器.

我试过不同的浏览器,它仍然是一样的.我检查了镀铬控制台,得到了:

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').
Run Code Online (Sandbox Code Playgroud)

有什么建议吗?

小智 8

您正在尝试同时配置此链接https://developers.google.com/analytics/devguides/collection/android/v4/start

所以请执行以下步骤 在此输入图像描述

单击GET A CONFIGURATION FILE

现在选择您的应用名称.
在此输入图像描述

单击配置服务 之后,将打开第三个窗口

在此输入图像描述

现在选择您的应用的Google Analytics帐户.

快点你做完了.

请使用所有过程并完成,因为您可以这样做.

如果您还有任何问题,请告诉我.


Sou*_*nti 3

好吧好吧,找到了解决方法。您控制台日志有帮助:我点击了日志中的 URL (" https://accounts.google.com/ServiceLogin?service=cloudconsole&osid=1&passiv \xe2\x80\xa63Dtrue%26cntlbl%3DContinue%2BAdding%2BAnalytics%26cntapi%3Danalytics&hl =en") 它引导我到正确的页面,我已经能够google-services.json为我的应用程序生成一个。

\n