UpendraSingh / analytics-issues

Automatically exported from code.google.com/p/analytics-issues
0 stars 0 forks source link

`AnalyticsService` throws NPE in `onStartCommand` trying to dereference a `null` intent. #667

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Name of affected component: Mobile Tracking

Name of related library and version, if applicable (e.g. Android, iOS,
Snippets, etc.): Android 4.x and 5.x / 
`com.google.android.gms:play-services:7.5.0`

Issue summary:
I see several reports of crashes within `AnalyticsService` trying to 
dereference a `null` intent reference in `onStartCommand()`:

Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Intent.getAction()' on a null object reference at com.google.android.gms.analytics.AnalyticsService.onStartCommand() at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3072) at android.app.ActivityThread.access$2100(ActivityThread.java:144) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1470) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:155) at android.app.ActivityThread.main(ActivityThread.java:5696) at java.lang.reflect.Method.invoke(Method.java) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1028) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823)


Steps to reproduce issue:
Unknown, I've only seen crash reports of this issue.

Expected output:
Nothing (i.e. no NPE) and proper handling of this case in `onStartCommand()`, 
or an exception which message clearly states the possible wrong usages of the 
analytics library which would have led to this error iff it is purposely not 
handled.

Actual results:
An uncaught NPE.

Notes:
See documentation for `onStartCommand` `intent` parameter:
> This may be null if the service is being restarted after its process has gone 
away, and it had previously returned anything except START_STICKY_COMPATIBILITY.

Original issue reported on code.google.com by legrand....@gmail.com on 15 Jun 2015 at 11:56

GoogleCodeExporter commented 8 years ago
I am seeing the same:

java.lang.RuntimeException: Unable to start service 
com.google.android.gms.analytics.AnalyticsService@41ede978 with null: 
java.lang.NullPointerException at 
android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2655) at 
android.app.ActivityThread.access$1900(ActivityThread.java:149) at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1397) at 
android.os.Handler.dispatchMessage(Handler.java:99) at 
android.os.Looper.loop(Looper.java:153) at 
android.app.ActivityThread.main(ActivityThread.java:4987) at 
java.lang.reflect.Method.invokeNative(Native Method) at 
java.lang.reflect.Method.invoke(Method.java:511) at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:821) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:584) at 
dalvik.system.NativeStart.main(Native Method) Caused by: 
java.lang.NullPointerException at 
com.google.android.gms.analytics.AnalyticsService.onStartCommand(Unknown 
Source) at 
android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2638) ... 10 
more

Original comment by jaredsburrows@gmail.com on 21 Jun 2015 at 10:28

GoogleCodeExporter commented 8 years ago
Ditto. Have this crash in production, 10x per day.

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)

Original comment by sure...@gmail.com on 27 Jun 2015 at 4:51

GoogleCodeExporter commented 8 years ago
Got this everyday

java.lang.RuntimeException: Unable to start service 
com.google.android.gms.analytics.AnalyticsService@4239c148 with null: 
java.lang.NullPointerException
       at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3127)
       at android.app.ActivityThread.access$2200(ActivityThread.java:174)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1422)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:146)
       at android.app.ActivityThread.main(ActivityThread.java:5756)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:515)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
       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:3110)
       at android.app.ActivityThread.access$2200(ActivityThread.java:174)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1422)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:146)
       at android.app.ActivityThread.main(ActivityThread.java:5756)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:515)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
       at dalvik.system.NativeStart.main(NativeStart.java)

Original comment by ano...@gmail.com on 30 Jun 2015 at 9:05

GoogleCodeExporter commented 8 years ago
Same issue here, I cannot reproduce it but my crash reporting tools is 
reporting this crash more than 100x per day. 

The OS seems to be always android 5.x

Original comment by adr...@zattoo.com on 1 Jul 2015 at 7:59

GoogleCodeExporter commented 8 years ago
@ #4 Yes! It is weird because I test with a 5.0 and a 5.1 device. I still 
cannot reproduce it.

Original comment by jaredsburrows@gmail.com on 1 Jul 2015 at 12:21

GoogleCodeExporter commented 8 years ago
We are getting the same error. Is anybody able to handle this??

Original comment by mobile-a...@shine.com on 7 Jul 2015 at 5:36

GoogleCodeExporter commented 8 years ago
@ #4 #5 : I get several reports of this crash happening on 4.x as well.

Original comment by legrand....@gmail.com on 7 Jul 2015 at 10:27

GoogleCodeExporter commented 8 years ago
i reported it too... any solutions?

Original comment by Gianni...@gmail.com on 27 Jul 2015 at 4:45

GoogleCodeExporter commented 8 years ago
Any solution to this yet? 
I am too having the same issue.

Original comment by paxplays...@gmail.com on 11 Aug 2015 at 8:06

GoogleCodeExporter commented 8 years ago
Same problem :

java.lang.RuntimeException: Unable to start service 
com.google.android.gms.analytics.AnalyticsService@5cae6ee with null: 
java.lang.NullPointerException: Attempt to invoke virtual method 
'java.lang.String android.content.Intent.getAction()' on a null object reference
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3279)
at android.app.ActivityThread.access$2200(ActivityThread.java:172)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1519)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5835)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1388)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1183)

Original comment by areveil...@gmail.com on 12 Aug 2015 at 3:22

GoogleCodeExporter commented 8 years ago
I am too stuck at the same issue :(

Original comment by paxplays...@gmail.com on 14 Aug 2015 at 3:04

GoogleCodeExporter commented 8 years ago
java.lang.RuntimeException: Unable to start service 
com.google.android.gms.analytics.AnalyticsService@389fa818 with null: 
java.lang.NullPointerException: Attempt to invoke virtual method 
'java.lang.String android.content.Intent.getAction()' on a null object reference
       at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3927)
       at android.app.ActivityThread.access$2300(ActivityThread.java:198)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1774)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:145)
       at android.app.ActivityThread.main(ActivityThread.java:6837)
       at java.lang.reflect.Method.invoke(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:372)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 
'java.lang.String android.content.Intent.getAction()' on a null object reference
       at com.google.android.gms.analytics.AnalyticsService.onStartCommand()
       at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3910)
       at android.app.ActivityThread.access$2300(ActivityThread.java:198)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1774)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:145)
       at android.app.ActivityThread.main(ActivityThread.java:6837)
       at java.lang.reflect.Method.invoke(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:372)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)

smae here

Original comment by erish2...@gmail.com on 17 Aug 2015 at 8:22

GoogleCodeExporter commented 8 years ago
I also see it happen in the 7.8.0 version of the library, but only on 5.x 
devices. It also reports different line numbers in the ActivityThread.java 
(2894, 2958, 3072, 3910, 2915, 2893, 3307, 3027)

Original comment by sasa.sek...@gmail.com on 26 Aug 2015 at 9:38

GoogleCodeExporter commented 8 years ago
Do we have any updates? 

I have to confirm this issue, used 7.5.0 in production which has this issue, 
now seems like upgrade to 7.8.0 will not fix that, we've got like 4 different 
stack-traces that exercise this issue

StackTraces from using google-play-services version 7.5.0
Android versions 4.2.9, 4.4.2 and 5.0
Devices are non-rooted, and specifically: SM-G800F, LG-V500, DAGGER DG550

========= 1 ===========
java.lang.RuntimeException: Unable to start service 
com.google.android.gms.analytics.AnalyticsService@42425680 with null: 
java.lang.NullPointerException
       at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3044)
       at android.app.ActivityThread.access$2200(ActivityThread.java:172)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:146)
       at android.app.ActivityThread.main(ActivityThread.java:5694)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:515)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
       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:3027)
       at android.app.ActivityThread.access$2200(ActivityThread.java:172)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:146)
       at android.app.ActivityThread.main(ActivityThread.java:5694)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:515)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
       at dalvik.system.NativeStart.main(NativeStart.java)

========= 2 ===========
java.lang.RuntimeException: Unable to start service 
com.google.android.gms.analytics.AnalyticsService@422b85c8 with null: 
java.lang.NullPointerException
       at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2728)
       at android.app.ActivityThread.access$2100(ActivityThread.java:139)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1297)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:136)
       at android.app.ActivityThread.main(ActivityThread.java:5103)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:515)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:606)
       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:2711)
       at android.app.ActivityThread.access$2100(ActivityThread.java:139)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1297)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:136)
       at android.app.ActivityThread.main(ActivityThread.java:5103)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:515)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:606)
       at dalvik.system.NativeStart.main(NativeStart.java)

========= 3 ===========
java.lang.RuntimeException: Unable to start service 
com.google.android.gms.analytics.AnalyticsService@41c79968 with null: 
java.lang.NullPointerException
       at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2872)
       at android.app.ActivityThread.access$1900(ActivityThread.java:167)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1475)
       at android.os.Handler.dispatchMessage(Handler.java:107)
       at android.os.Looper.loop(Looper.java:194)
       at android.app.ActivityThread.main(ActivityThread.java:5405)
       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:838)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
       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:2855)
       at android.app.ActivityThread.access$1900(ActivityThread.java:167)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1475)
       at android.os.Handler.dispatchMessage(Handler.java:107)
       at android.os.Looper.loop(Looper.java:194)
       at android.app.ActivityThread.main(ActivityThread.java:5405)
       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:838)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
       at dalvik.system.NativeStart.main(NativeStart.java)

========= 4 ===========
java.lang.RuntimeException: Unable to start service 
com.google.android.gms.analytics.AnalyticsService@58cb674 with null: 
java.lang.NullPointerException: Attempt to invoke virtual method 
'java.lang.String android.content.Intent.getAction()' on a null object reference
       at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3276)
       at android.app.ActivityThread.access$2200(ActivityThread.java:172)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1520)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:145)
       at android.app.ActivityThread.main(ActivityThread.java:5832)
       at java.lang.reflect.Method.invoke(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:372)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 
'java.lang.String android.content.Intent.getAction()' on a null object reference
       at com.google.android.gms.analytics.AnalyticsService.onStartCommand()
       at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3259)
       at android.app.ActivityThread.access$2200(ActivityThread.java:172)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1520)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:145)
       at android.app.ActivityThread.main(ActivityThread.java:5832)
       at java.lang.reflect.Method.invoke(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:372)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)

Original comment by Marek.Se...@gmail.com on 2 Sep 2015 at 12:46

GoogleCodeExporter commented 8 years ago
is there any update to this?

Original comment by nzan...@gmail.com on 6 Sep 2015 at 11:53

GoogleCodeExporter commented 8 years ago
Any update ??

Original comment by areveil...@gmail.com on 13 Sep 2015 at 11:33

GoogleCodeExporter commented 8 years ago
It happen to me... But look like just only happen when I crash my app. Maybe my 
app crash because of another issue, and stop the Application before reporting 
to GA. Nothing sure now...

Original comment by nkim...@gmail.com on 25 Sep 2015 at 2:33

GoogleCodeExporter commented 8 years ago
Just had the issue myself, the app crashed while being in background. Since my 
app does nothing in background it has to be a problem with GA. It's also good 
to know that it might not affect the users as much as we could think: having an 
app crashing in background is not that big of a deal (except if your app 
actually does things in background), it mainly looks bad.

Original comment by melvin.l...@gmail.com on 7 Oct 2015 at 1:18

GoogleCodeExporter commented 8 years ago
I'm using google play services 8.1.0, also happening. 20+ crashes a day.

Original comment by kro...@gmail.com on 12 Oct 2015 at 3:57

GoogleCodeExporter commented 8 years ago
Also happening here...

For us, it has happened when the user left his phone idle for some time and 
then returned to the application. It might have occurred in the moment my app 
tried to send an analytics screen view event.

Or maybe it occurred at the moment the app was trying to send batch events 
using the AnalyticsService.

Original comment by alexk...@gmail.com on 12 Oct 2015 at 7:20

GoogleCodeExporter commented 8 years ago
I'm facing same problem its showing me Anr , whats the solution for this?

Original comment by supp...@lococabs.com on 14 Oct 2015 at 9:54

GoogleCodeExporter commented 8 years ago
Me too...

java.lang.RuntimeException: Unable to start service 
com.google.android.gms.analytics.AnalyticsService@426601f8 with null: 
java.lang.NullPointerException
       at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2927)
       at android.app.ActivityThread.access$2200(ActivityThread.java:166)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1378)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:146)
       at android.app.ActivityThread.main(ActivityThread.java:5511)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:515)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
       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:2910)
       at android.app.ActivityThread.access$2200(ActivityThread.java:166)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1378)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:146)
       at android.app.ActivityThread.main(ActivityThread.java:5511)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:515)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
       at dalvik.system.NativeStart.main(NativeStart.java)

Original comment by cliff...@gmail.com on 14 Oct 2015 at 10:13

GoogleCodeExporter commented 8 years ago
android 4.4.2
----------------------------
java.lang.RuntimeException: Unable to start service 
com.google.android.gms.analytics.AnalyticsService@4298a650 with null: 
java.lang.NullPointerException
       at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2889)
       at android.app.ActivityThread.access$2200(ActivityThread.java:164)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1365)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:157)
       at android.app.ActivityThread.main(ActivityThread.java:5377)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:515)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
       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:2872)
       at android.app.ActivityThread.access$2200(ActivityThread.java:164)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1365)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:157)
       at android.app.ActivityThread.main(ActivityThread.java:5377)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:515)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
       at dalvik.system.NativeStart.main(NativeStart.java)

android 5.1.1
----------------------------
java.lang.RuntimeException: Unable to start service 
com.google.android.gms.analytics.AnalyticsService@1de87640 with null: 
java.lang.NullPointerException: Attempt to invoke virtual method 
'java.lang.String android.content.Intent.getAction()' on a null object reference
       at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3927)
       at android.app.ActivityThread.access$2300(ActivityThread.java:198)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1774)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:145)
       at android.app.ActivityThread.main(ActivityThread.java:6837)
       at java.lang.reflect.Method.invoke(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:372)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 
'java.lang.String android.content.Intent.getAction()' on a null object reference
       at com.google.android.gms.analytics.AnalyticsService.onStartCommand()
       at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3910)
       at android.app.ActivityThread.access$2300(ActivityThread.java:198)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1774)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:145)
       at android.app.ActivityThread.main(ActivityThread.java:6837)
       at java.lang.reflect.Method.invoke(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:372)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)

Original comment by angeld...@gmail.com on 19 Oct 2015 at 1:37

GoogleCodeExporter commented 8 years ago
Same error:

Versión de Android

Android 5.0
1
Dispositivo

MOTO G (titan_umts)

java.lang.RuntimeException: Unable to start service 
com.google.android.gms.analytics.AnalyticsService@1c316b18 with null: 
java.lang.NullPointerException: Attempt to invoke virtual method 
'java.lang.String android.content.Intent.getAction()' on a null object reference
    at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2913)
    at android.app.ActivityThread.access$2100(ActivityThread.java:148)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1390)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:135)
    at android.app.ActivityThread.main(ActivityThread.java:5312)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:696)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 
'java.lang.String android.content.Intent.getAction()' on a null object reference
    at com.google.android.gms.analytics.AnalyticsService.onStartCommand(Unknown Source)
    at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2896)
    ... 9 more

Original comment by oscar.lo...@venko.co on 1 Nov 2015 at 3:21

GoogleCodeExporter commented 8 years ago
Getting daily crash reports of the app similar to above. Currently using 8.3.0 
but not sure how to solve the issue as it just points to the 
ActivityThread.java file (at different lines).

Fatal Exception: java.lang.RuntimeException: Unable to start service 
com.google.android.gms.analytics.CampaignTrackingService@c124003 with null: 
java.lang.NullPointerException: Attempt to invoke virtual method 
'java.lang.String android.content.Intent.getStringExtra(java.lang.String)' on a 
null object reference
       at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3009)
       at android.app.ActivityThread.access$2100(ActivityThread.java:162)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1447)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:135)
       at android.app.ActivityThread.main(ActivityThread.java:5431)
       at java.lang.reflect.Method.invoke(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:372)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:914)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:707)
Caused by java.lang.NullPointerException: Attempt to invoke virtual method 
'java.lang.String android.content.Intent.getStringExtra(java.lang.String)' on a 
null object reference
       at com.google.android.gms.analytics.CampaignTrackingService.onStartCommand(Unknown Source)
       at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2992)
       at android.app.ActivityThread.access$2100(ActivityThread.java:162)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1447)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:135)
       at android.app.ActivityThread.main(ActivityThread.java:5431)
       at java.lang.reflect.Method.invoke(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:372)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:914)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:707)

Original comment by laurence...@gmail.com on 30 Nov 2015 at 3:13

GoogleCodeExporter commented 8 years ago
To stop getting this errors you can remove the optional receivers and services 
from your android manifest:

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

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

Removing this will disable background dispatching on devices without google 
play services and campaign traking

Original comment by angeld...@gmail.com on 3 Dec 2015 at 9:23

GoogleCodeExporter commented 8 years ago
Does anyone managed to solve this? Play services 8.1.0 and still happens.

Original comment by gmac...@gmail.com on 24 Dec 2015 at 9:15

GoogleCodeExporter commented 8 years ago
Facing the same issue

Original comment by kris...@qikstay.com on 28 Dec 2015 at 8:08

Attachments:

GoogleCodeExporter commented 8 years ago
Facing same issue. Any updates?

Original comment by pranshu....@gmail.com on 28 Dec 2015 at 7:34

GoogleCodeExporter commented 8 years ago
facing same issue?

Original comment by sand...@freekaamaal.com on 4 Jan 2016 at 4:32

GoogleCodeExporter commented 8 years ago
facing same issue?

I'm using google play services 7.8.0

Fatal Exception: java.lang.RuntimeException: Unable to start service 
com.google.android.gms.analytics.AnalyticsService@431b0d28 with null: 
java.lang.NullPointerException
       at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2781)
       at android.app.ActivityThread.access$2100(ActivityThread.java:144)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1343)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:212)
       at android.app.ActivityThread.main(ActivityThread.java:5151)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:515)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:875)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:691)
       at dalvik.system.NativeStart.main(NativeStart.java)
Caused by java.lang.NullPointerException
       at com.google.android.gms.analytics.AnalyticsService.onStartCommand(Unknown Source)
       at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2764)
       at android.app.ActivityThread.access$2100(ActivityThread.java:144)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1343)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:212)
       at android.app.ActivityThread.main(ActivityThread.java:5151)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:515)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:875)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:691)
       at dalvik.system.NativeStart.main(NativeStart.java)

Original comment by quan...@sunivy.com.vn on 7 Jan 2016 at 2:27

GoogleCodeExporter commented 8 years ago
In play services 8.3.0 is still happens.

Original comment by VKosten...@gmail.com on 29 Jan 2016 at 7:41

GoogleCodeExporter commented 8 years ago
In play services 8.4.0 it still happens.

Will removing the optional services and/or receivers effect the data collected? 
Or will we just not receive data from devices that don't have Google Services 
installed?

Original comment by James.G.Britton on 5 Feb 2016 at 11:12

GoogleCodeExporter commented 8 years ago

Original comment by t...@google.com on 7 Mar 2016 at 10:27

GoogleCodeExporter commented 8 years ago
Facing same issue , Any updates ?

Original comment by Amr.Moha...@gmail.com on 8 Mar 2016 at 9:13

GoogleCodeExporter commented 8 years ago
Any updates ?

Original comment by develope...@gmail.com on 9 Mar 2016 at 3:21

GoogleCodeExporter commented 8 years ago
Facing same issue. Any updates?

java.lang.RuntimeException: Unable to start service 
com.google.android.gms.analytics.AnalyticsService@17064f1e with null: 
java.lang.NullPointerException: Attempt to invoke virtual method 
'java.lang.String android.content.Intent.getAction()' on a null object reference
    at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3276)
    at android.app.ActivityThread.access$2200(ActivityThread.java:172)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1520)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:145)
    at android.app.ActivityThread.main(ActivityThread.java:5832)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 
'java.lang.String android.content.Intent.getAction()' on a null object reference
    at com.google.android.gms.analytics.AnalyticsService.onStartCommand(Unknown Source)
    at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3259)
    ... 9 more

Original comment by danielbragion on 14 Mar 2016 at 11:37

GoogleCodeExporter commented 8 years ago
Nothing this is dead by Analytics team.

Original comment by sir.lo...@gmail.com on 15 Mar 2016 at 2:39