本文介绍了针对Firebase和Google Analytics的google-services.json的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的项目中使用Google Analytics和Firebase。我已经从Firebase控制台设置下载了google-services.json文件,但是在使用之后,我无法支持Google Analytics(分析)。它显示错误:

$ p $ $ div> > from Firebase console, analytics-service 看起来像这样: analytics_service:{
status:1
},

因为我已经按照的指示配置了Google Analytics(分析),使用 global_tracker.xml 文件,似乎没有必要在 google-services.json 中配置它。


I want to use Google Analytics and Firebase both in my project. I have downloaded google-services.json file from the Firebase console settings but after using it, I am not able to support Google Analytics. It is showing me the error:

Error:(463, 49) error: cannot find symbol variable global_tracker

How to configure both in same .json file?

Following field is missing from .json file downloaded from firebase dashboard.

"services": {
    "analytics_service": {
      "status": 2,
      "analytics_property": {
        "tracking_id": "some_tracking_id"
      }
    },
解决方案

When I downloaded google-services.json from Firebase console, analytics-service looked like this:

"analytics_service": {
      "status": 1
    },

However, since I have configured Google analytics as instructed here using global_tracker.xml file, it seems there is no need to have it configured in the google-services.json.

这篇关于针对Firebase和Google Analytics的google-services.json的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 12:43