Android – Google Play Services 7.5.0 AnalyticsService NPE onStartCommand

前端之家收集整理的这篇文章主要介绍了Android – Google Play Services 7.5.0 AnalyticsService NPE onStartCommand前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
在他们的应用程序中加载Google Play 7.5.0时是否有人遇到这个事件?我现在每天看到大约有30次崩溃,没有任何方法可以复制.没有什么特别的 Android风格(4.4,5,5.1)或设备(三星,HTC等)正在向我展示.
java.lang.RuntimeException: Unable to start service com.google.android.gms.analytics.AnalyticsService@1153b3b0 with null:     java.lang.NullPointerException
   at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2721)
   at android.app.ActivityThread.access$1900(ActivityThread.java:141)
   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1353)
   at android.os.Handler.dispatchMessage(Handler.java:99)
   at android.os.Looper.loop(Looper.java:137)
   at android.app.ActivityThread.main(ActivityThread.java:5116)
   at java.lang.reflect.Method.invokeNative(Method.java)
   at java.lang.reflect.Method.invoke(Method.java:525)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
   at dalvik.system.NativeStart.main(NativeStart.java)
Caused by: java.lang.NullPointerException
   at com.google.android.gms.analytics.AnalyticsService.onStartCommand()
   at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2704)
   at android.app.ActivityThread.access$1900(ActivityThread.java:141)
   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1353)
   at android.os.Handler.dispatchMessage(Handler.java:99)
   at android.os.Looper.loop(Looper.java:137)
   at android.app.ActivityThread.main(ActivityThread.java:5116)
   at java.lang.reflect.Method.invokeNative(Method.java)
   at java.lang.reflect.Method.invoke(Method.java:525)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
   at dalvik.system.NativeStart.main(NativeStart.java)

这个问题也已经发布在Google Analytics(分析)bug跟踪器上,但是我并不期望看到有一段时间的移动:https://code.google.com/p/analytics-issues/issues/detail?id=667

这是我的Gradle文件中的内容

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

在我的AndroidManifest(我认为是从Google文档逐字删除)中:

<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" />

解决方法

尝试使用最新的Google Play服务SDK版本.它已在Google Play服务9.2.1中修复.
原文链接:https://www.f2er.com/android/313337.html

猜你在找的Android相关文章