找不到符号类GoogleAnalytics v4

时间:2021-10-07 13:52:45

I am trying to implement Google Analytics v4 in my app but after i imported it with gradle using:

我正在尝试在我的应用中实施Google Analytics v4但在使用gradle导入后使用:

compile 'com.google.android.gms:play-services:7.5.0'

i still get the error

我仍然得到错误

cannot find symbol class GoogleAnalytics

2 个解决方案

#1


0  

Actually in my project i am missing the Module:app's build.gradle file. In order to make the Analytics v4 api work you need to put the compile 'com.google.android.gms:play-services:7.5.0' line in the main app module.

实际上在我的项目中我错过了Module:app的build.gradle文件。为了使Analytics v4 api正常工作,您需要在主应用程序模块中放置编译“com.google.android.gms:play-services:7.5.0”行。

#2


0  

Not necessarily in the main app module; you need to add to build.gradle file of any module in which you access GoogleAnalytics SDK.

不一定在主app模块中;您需要添加到访问GoogleAnalytics SDK的任何模块的build.gradle文件。

#1


0  

Actually in my project i am missing the Module:app's build.gradle file. In order to make the Analytics v4 api work you need to put the compile 'com.google.android.gms:play-services:7.5.0' line in the main app module.

实际上在我的项目中我错过了Module:app的build.gradle文件。为了使Analytics v4 api正常工作,您需要在主应用程序模块中放置编译“com.google.android.gms:play-services:7.5.0”行。

#2


0  

Not necessarily in the main app module; you need to add to build.gradle file of any module in which you access GoogleAnalytics SDK.

不一定在主app模块中;您需要添加到访问GoogleAnalytics SDK的任何模块的build.gradle文件。