谷歌Analytics(分析)V4在Android中:找不到类的com.google.android.gms.analytics.Tracker“ [英] Google Analytics v4 in Android: Could not find class 'com.google.android.gms.analytics.Tracker'
问题描述
我拼命GA V4在我的Android应用程序集成。
我跟着莅临指导 https://developers.google.com/analytics/ devguides /收集/安卓/ V4 /
I am desperately trying to integrate GA v4 in my Android app. And I followed the guide here https://developers.google.com/analytics/devguides/collection/android/v4/
和集成谷歌播放服务的lib的描述,但它给了我
And integrated Google Play Services lib as described, but it gives me
找不到类的com.google.android.gms.analytics.Tracker
不过,我可以找到项目中的类和它的命名空间。
But I can find classes and its namespaces in the project.
我想不出这里发生了什么。
I can't figure out what's happening here.
推荐答案
我也跟着上的 Analytics(分析)为Android V4 。
但另外我不得不更新播放服务,并在SDK管理器构建工具。然后,我不得不添加编译com.google.android.gms:发挥服务:8.4.0
在应用程序的build.gradle(高于编译com.google.android.gms:发挥服务 - 分析:8.4.0。
追踪器类还是个未知(红色下划线),但尽管我$ p $的pssed运行Android Studio中(安装应用程序),然后才分析被认可,并且可以使用。
But additionally I had to update play services and build tools in the SDK manager. Then I had to add compile 'com.google.android.gms:play-services:8.4.0'
in the app build.gradle (above of compile 'com.google.android.gms:play-services-analytics:8.4.0'
. The Tracker class was still unknown (red underlined) but despite of that I pressed "Run" (install app) in Android Studio and only then analytics was recognized and could be used.
这篇关于谷歌Analytics(分析)V4在Android中:找不到类的com.google.android.gms.analytics.Tracker“的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!