AnalyticsService没有在应用清单注册 - 错误 [英] AnalyticsService not registered in the app manifest - error

查看:444
本文介绍了AnalyticsService没有在应用清单注册 - 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想实现谷歌分析服务,使用SDK网站提供以下文件Android应用程序。

I am trying to implement google analytic service to android app using following documentation provided in sdk site.

<一个href="https://developers.google.com/analytics/devguides/collection/android/v4/">https://developers.google.com/analytics/devguides/collection/android/v4/

我无法看到在分析管理网站的任何信息。

I am unable to see any information in the analytics admin site.

在应用程序运行时,我看到下面的调试信息

While the app running, I am seeing following debug message

在应用清单未注册AnalyticsService。撞击可能并非可靠传送。请参见 http://goo.gl/8Rd3yj的说明。

"AnalyticsService not registered in the app manifest. Hits might not be delivered reliably. See http://goo.gl/8Rd3yj for instructions."

您可以请建议我如何注册该服务?

Can you please suggest me how to register this service?

推荐答案

我不知道,如果作用于该警告将解决您有(也就是没有看到在Analytics(分析)管理网站的任何信息)的问题。

I am not sure if acting on this warning will solve the issue you're having (i.e. not seeing any information in the Analytics admin site).

总之,这里是你应该添加到AndroidManifest.xml中的应用程序标签中,如果你想摆脱这种警告:

Anyway, here is what you should add to AndroidManifest.xml inside the application tag if you want to get rid of this warning:

 <!-- Optionally, register AnalyticsReceiver and AnalyticsService to support background
      dispatching on non-Google Play devices -->
 <receiver android:name="com.google.android.gms.analytics.AnalyticsReceiver"
     android:enabled="true">
     <intent-filter>
         <action android:name="com.google.android.gms.analytics.ANALYTICS_DISPATCH" />
     </intent-filter>
 </receiver>
 <service android:name="com.google.android.gms.analytics.AnalyticsService"
     android:enabled="true"
     android:exported="false"/>

 <!-- Optionally, register CampaignTrackingReceiver and CampaignTrackingService to enable
      installation campaign reporting -->
 <receiver android:name="com.google.android.gms.analytics.CampaignTrackingReceiver"
     android:exported="true">
     <intent-filter>
         <action android:name="com.android.vending.INSTALL_REFERRER" />
     </intent-filter>
 </receiver>
 <service android:name="com.google.android.gms.analytics.CampaignTrackingService" />

您不必添加这一切,只需要添加你所需要的。在你的情况,你显然只需要添加 AnalyticsService 服务。

You don't have to add all of this, just add what you need. In your case, you apparently just need to add the AnalyticsService service.

来源:<一href="https://developer.android.com/reference/com/google/android/gms/analytics/GoogleAnalytics.html">https://developer.android.com/reference/com/google/android/gms/analytics/GoogleAnalytics.html

这篇关于AnalyticsService没有在应用清单注册 - 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆