我正尝试在我的应用中实现 Google Analytics。在 Unity 编辑器上尝试时,我可以看到命中率,还可以在分析仪表板中看到实时用户。但是,当我在设备上构建游戏时,我无法实时看到用户。我等待一天没有数据从设备发送。
try {
googleAnalytics.LogScreen(new AppViewHitBuilder()
.SetScreenName("Main Menu"));;
debuggerText.text = "Succes";
} catch (System.Exception ex) {
debuggerText.text = ex.ToString();
}
这在桌面和设备上都返回成功,但在设备上没有数据发送。 我搜索了所有类似的问题,但没有任何帮助? 知道我做错了什么吗?
最佳答案
find the logs. Here 04-15 16:02:09.657: E/GMPM(12430): GoogleService failed to initialize, status: 10, Missing an expected resource: 'R.string.google_app_id' for initializing Google services. Possible causes are missing google-services.json or com.google.gms.google-services gradle plugin.
现在,当您阅读日志后,您必须修复原因:缺少预期的资源:“R.string.google_app_id”
这里是 GoogleService failed to initialize解决方案。
关于android - Google Analytics 适用于桌面设备,但不适用于 Android 设备,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36645593/