rafael
rafael

Reputation: 732

Service Intent must be explicit - Google Analytics

Possibly duplicate of Android 5.0 (L) Service Intent must be explicit 2 with minor differences

Im getting this error in Lollipop - Nexus 5

java.lang.IllegalArgumentException: Service Intent must be explicit: Intent { act=com.google.android.gms.analytics.service.START (has extras) }
        at android.app.ContextImpl.validateServiceIntent(ContextImpl.java:1674)
        at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1773)
        at android.app.ContextImpl.bindService(ContextImpl.java:1751)
        at android.content.ContextWrapper.bindService(ContextWrapper.java:538)
        at com.google.analytics.tracking.android.AnalyticsGmsCoreClient.connect(AnalyticsGmsCoreClient.java:82)
        at com.google.analytics.tracking.android.GAServiceProxy.connectToService(GAServiceProxy.java:330)
        at com.google.analytics.tracking.android.GAServiceProxy.createService(GAServiceProxy.java:210)
        at com.google.analytics.tracking.android.GAThread.init(GAThread.java:85)
        at com.google.analytics.tracking.android.GAThread.run(GAThread.java:352)

I had my project using maven with google analytics v3 and play services 4.3.23 and everything work fine even in lollipop nexus 5.

After i migrate to gradle, i kept analytics v3 and updated play services to 6.1.71, don't know if this could be the problem

More stacktrace

2-04 14:23:42.331  13618-13759/com.xxxxxx.mypackage V/GAV3﹕ Thread[GAThread,5,main]: connecting to Analytics service
12-04 14:23:42.337  13618-13759/com.xxxxxx.mypackage W/System.err﹕ java.lang.IllegalArgumentException: Service Intent must be explicit: Intent { act=com.google.android.gms.analytics.service.START (has extras) }
12-04 14:23:42.337  13618-13759/com.xxxxxx.mypackage W/System.err﹕ at android.app.ContextImpl.validateServiceIntent(ContextImpl.java:1674)
12-04 14:23:42.337  13618-13759/com.xxxxxx.mypackage W/System.err﹕ at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1773)
12-04 14:23:42.338  13618-13759/com.xxxxxx.mypackage W/System.err﹕ at android.app.ContextImpl.bindService(ContextImpl.java:1751)
12-04 14:23:42.338  13618-13759/com.xxxxxx.mypackage W/System.err﹕ at android.content.ContextWrapper.bindService(ContextWrapper.java:538)
12-04 14:23:42.338  13618-13759/com.xxxxxx.mypackage W/System.err﹕ at com.google.analytics.tracking.android.AnalyticsGmsCoreClient.connect(AnalyticsGmsCoreClient.java:82)
12-04 14:23:42.338  13618-13759/com.xxxxxx.mypackage W/System.err﹕ at com.google.analytics.tracking.android.GAServiceProxy.connectToService(GAServiceProxy.java:330)
12-04 14:23:42.338  13618-13759/com.xxxxxx.mypackage W/System.err﹕ at com.google.analytics.tracking.android.GAServiceProxy.createService(GAServiceProxy.java:210)
12-04 14:23:42.338  13618-13759/com.xxxxxx.mypackage W/System.err﹕ at com.google.analytics.tracking.android.GAThread.init(GAThread.java:85)
12-04 14:23:42.338  13618-13759/com.xxxxxx.mypackage W/System.err﹕ at com.google.analytics.tracking.android.GAThread.run(GAThread.java:352)
12-04 14:23:42.342  13618-13759/com.xxxxxx.mypackage W/FlurryAgent﹕ Error logged: uncaught
12-04 14:23:42.342  13618-13759/com.xxxxxx.mypackage W/FlurryAgent﹕ Trying to end session
12-04 14:23:42.346  13618-13759/com.xxxxxx.mypackage W/FlurryAgent﹕ Ending session
12-04 14:23:42.350  13618-13759/com.xxxxxx.mypackage V/GAV3﹕ Thread[GAThread,5,main]: Tracking Exception: IllegalArgumentException (@ContextImpl:validateServiceIntent:1674) {GAThread}
12-04 14:23:42.351  13618-13759/com.xxxxxx.mypackage V/GAV3﹕ Thread[GAThread,5,main]: Dispatch call queued. Dispatch will run once initialization is complete.
12-04 14:23:42.351  13618-13759/com.xxxxxx.mypackage V/GAV3﹕ Thread[GAThread,5,main]: Passing exception to original handler.
12-04 14:23:42.351  13618-13759/com.xxxxxx.mypackage E/ACRA﹕ ACRA caught a IllegalArgumentException exception for com.xxxxxx.mypackage. Building report.
12-04 14:23:42.565  13618-13759/com.xxxxxx.mypackage I/ACRA﹕ READ_LOGS granted! ACRA can include LogCat and DropBox data.
12-04 14:23:42.603  13618-13759/com.xxxxxx.mypackage D/ACRA﹕ Retrieving logcat output...
12-04 14:23:42.629  13618-13759/com.xxxxxx.mypackage D/ACRA﹕ Writing crash report file 1417710222000.stacktrace.
12-04 14:23:42.643  13618-13759/com.xxxxxx.mypackage D/ACRA﹕ About to start ReportSenderWorker from #handleException
12-04 14:23:42.645  13618-14173/com.xxxxxx.mypackage D/ACRA﹕ Mark all pending reports as approved.
12-04 14:23:42.645  13618-14173/com.xxxxxx.mypackage D/ACRA﹕ Looking for error files in /data/data/com.xxxxxx.mypackage/files
12-04 14:23:42.646  13618-14174/com.xxxxxx.mypackage D/ACRA﹕ Waiting for Toast + worker...
12-04 14:23:42.649  13618-14173/com.xxxxxx.mypackage D/ACRA﹕ #checkAndSendReports - start
12-04 14:23:42.649  13618-14173/com.xxxxxx.mypackage D/ACRA﹕ Looking for error files in /data/data/com.xxxxxx.mypackage/files
12-04 14:23:42.650  13618-14173/com.xxxxxx.mypackage I/ACRA﹕ Sending file 1417710222000-approved.stacktrace
12-04 14:23:42.661  13618-14173/com.xxxxxx.mypackage D/ACRA﹕ Sending report 180cde9c-d8e3-4d00-b677-185630e6c44b
12-04 14:23:42.661  13618-14173/com.xxxxxx.mypackage D/ACRA﹕ Connect to https://docs.google.com/spreadsheet/formResponse?formkey=dE04R1o0VjJDM29QXaQ2ZTVjSVNzdGc6MQ&ifq
12-04 14:23:42.708  13618-14173/com.xxxxxx.mypackage D/ACRA﹕ Sending request to https://docs.google.com/spreadsheet/formResponse?formkey=dE04R1o0VjJDM29QXaQ2ZTVjSVNzdGc6MQ&ifq
12-04 14:23:42.991  13618-13618/com.xxxxxx.mypackage I/INFO﹕ Address from preferences ->null
12-04 14:23:42.991  13618-13618/com.xxxxxx.mypackage I/INFO﹕ Address from preferences ->null
12-04 14:23:42.991  13618-13618/com.xxxxxx.mypackage I/INFO﹕ Address from preferences ->null
12-04 14:23:42.991  13618-13618/com.xxxxxx.mypackage I/INFO﹕ Address from preferences ->null
12-04 14:23:42.991  13618-13618/com.xxxxxx.mypackage I/INFO﹕ Address from preferences ->null
12-04 14:23:42.991  13618-13618/com.xxxxxx.mypackage I/INFO﹕ Address from preferences ->null
12-04 14:23:43.000  13618-13618/com.xxxxxx.mypackage I/INFO﹕ *****************************
12-04 14:23:43.000  13618-13618/com.xxxxxx.mypackage I/INFO﹕ Cancel move camera
12-04 14:23:43.000  13618-13618/com.xxxxxx.mypackage I/INFO﹕ *****************************
12-04 14:23:43.059  13618-13618/com.xxxxxx.mypackage V/GCMBroadcastReceiver﹕ onReceive: com.google.android.c2dm.intent.REGISTRATION
12-04 14:23:43.059  13618-13618/com.xxxxxx.mypackage V/GCMBroadcastReceiver﹕ GCM IntentService class: com.xxxxxx.mypackage.GCMIntentService
12-04 14:23:43.061  13618-13618/com.xxxxxx.mypackage V/GCMBaseIntentService﹕ Acquiring wakelock
12-04 14:23:43.066  13618-13618/com.xxxxxx.mypackage V/GCMBaseIntentService﹕ Intent service name: GCMIntentService-670358886800-1
12-04 14:23:43.066  13618-13618/com.xxxxxx.mypackage E/GCMBaseIntentService﹕ [GCMIntentService] start
12-04 14:23:43.069  13618-14192/com.xxxxxx.mypackage E/GCMRegistrar﹕ internal error: retry receiver class not set yet
12-04 14:23:43.070  13618-13618/com.xxxxxx.mypackage V/GCMBroadcastReceiver﹕ onReceive: com.google.android.c2dm.intent.REGISTRATION
12-04 14:23:43.070  13618-14192/com.xxxxxx.mypackage V/GCMRegistrar﹕ Registering receiver
12-04 14:23:43.070  13618-13618/com.xxxxxx.mypackage V/GCMBroadcastReceiver﹕ GCM IntentService class: com.xxxxxx.mypackage.GCMIntentService
12-04 14:23:43.070  13618-13618/com.xxxxxx.mypackage V/GCMBaseIntentService﹕ Acquiring wakelock
12-04 14:23:43.073  13618-14192/com.xxxxxx.mypackage D/GCMBaseIntentService﹕ handleRegistration: registrationId = null, error = null, unregistered = com.xxxxxx.mypackage
12-04 14:23:43.074  13618-14192/com.xxxxxx.mypackage D/GCMRegistrar﹕ resetting backoff for com.xxxxxx.mypackage
12-04 14:23:43.074  13618-14192/com.xxxxxx.mypackage V/GCMRegistrar﹕ Saving regId on app version 25
12-04 14:23:43.089  13618-14192/com.xxxxxx.mypackage V/GCMIntentService onUnregistered﹕ [ 12-04 14:23:43.090 13618:14192 V/GCMBaseIntentService ]
    Releasing wakelock
12-04 14:23:43.092  13618-14192/com.xxxxxx.mypackage D/GCMBaseIntentService﹕ handleRegistration: registrationId = APA91bHiOw6h7JU9dvLc1Qqw04GXQkrlbV-4LZIQfO6e8uIEGaFSsVNqsdmTi53PXZVEARzI6XLxK3rXXM3OrUm8wIRC0jmgB2yXrrVRoTkSvwQXtPSywJR2AJkcs_2a39KwvLxnyN97JLdP8hVVLtSElBCGYLNMyDIlXYWC01i7Th4OyVA1FOM, error = null, unregistered = null
12-04 14:23:43.092  13618-14192/com.xxxxxx.mypackage D/GCMRegistrar﹕ resetting backoff for com.xxxxxx.mypackage
12-04 14:23:43.095  13618-14192/com.xxxxxx.mypackage V/GCMRegistrar﹕ Saving regId on app version 25
12-04 14:23:43.116  13618-14192/com.xxxxxx.mypackage V/GCMIntentService onRegistered﹕ APA91bHiOw6h7JU9dvLc1Qqw04GXQkrlbV-4LZIQfO6e8uIEGaFSsVNqsdmTi53PXZVEARzI6XLxK3rXXM3OrUm8wIRC0jmgB2yXrrVRoTkSvwQXtPSywJR2AJkcs_2a39KwvLxnyN97JLdP8hVVLtSElBCGYLNMyDIlXYWC01i7Th4OyVA1FOM
12-04 14:23:43.116  13618-14192/com.xxxxxx.mypackage V/GCMBaseIntentService﹕ Releasing wakelock
12-04 14:23:43.660  13618-13634/com.xxxxxx.mypackage I/art﹕ Background sticky concurrent mark sweep GC freed 57034(3MB) AllocSpace objects, 53(2MB) LOS objects, 13% free, 35MB/41MB, paused 8.499ms total 70.673ms
12-04 14:23:43.872  13618-14173/com.xxxxxx.mypackage W/ResponseProcessCookies﹕ Invalid cookie header: "Set-Cookie: NID=67=rrqRFddFUdEd6qmmRaW7u3wCSFSDlVoFobX4NqYeDntag4sOwuzwAeWjh6q3tsENizFX-5igAcBPOUj0M_QXkQKGPfKeCzpDD5-oXrveoj8D1flwIx1TCB5v8i0F6CHR;Domain=.google.com;Path=/;Expires=Fri, 05-Jun-2015 16:24:18 GMT;HttpOnly". Unable to parse expires attribute: Fri
12-04 14:23:43.872  13618-14173/com.xxxxxx.mypackage E/ACRA﹕ Failed to send crash report for 1417710222000-approved.stacktrace
    org.acra.sender.ReportSenderException: Error while sending report to Google Form.
            at org.acra.sender.GoogleFormSender.send(GoogleFormSender.java:88)
            at org.acra.SendWorker.sendCrashReport(SendWorker.java:178)
            at org.acra.SendWorker.checkAndSendReports(SendWorker.java:141)
            at org.acra.SendWorker.run(SendWorker.java:77)
     Caused by: java.io.IOException: Host returned error code 404
            at org.acra.util.HttpRequest.sendPost(HttpRequest.java:139)
            at org.acra.sender.GoogleFormSender.send(GoogleFormSender.java:85)
            at org.acra.SendWorker.sendCrashReport(SendWorker.java:178)
            at org.acra.SendWorker.checkAndSendReports(SendWorker.java:141)
            at org.acra.SendWorker.run(SendWorker.java:77)
12-04 14:23:43.873  13618-14173/com.xxxxxx.mypackage D/ACRA﹕ #checkAndSendReports - finish
12-04 14:23:43.950  13618-14174/com.xxxxxx.mypackage D/ACRA﹕ Wait for Toast + worker ended. Kill Application ? true
12-04 14:23:43.951  13618-14174/com.xxxxxx.mypackage E/AndroidRuntime﹕ FATAL EXCEPTION: GAThread
    Process: com.xxxxxx.mypackage, PID: 13618
    java.lang.IllegalArgumentException: Service Intent must be explicit: Intent { act=com.google.android.gms.analytics.service.START (has extras) }
            at android.app.ContextImpl.validateServiceIntent(ContextImpl.java:1674)
            at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1773)
            at android.app.ContextImpl.bindService(ContextImpl.java:1751)
            at android.content.ContextWrapper.bindService(ContextWrapper.java:538)
            at com.google.analytics.tracking.android.AnalyticsGmsCoreClient.connect(AnalyticsGmsCoreClient.java:82)
            at com.google.analytics.tracking.android.GAServiceProxy.connectToService(GAServiceProxy.java:330)
            at com.google.analytics.tracking.android.GAServiceProxy.createService(GAServiceProxy.java:210)
            at com.google.analytics.tracking.android.GAThread.init(GAThread.java:85)
            at com.google.analytics.tracking.android.GAThread.run(GAThread.java:352)

Upvotes: 3

Views: 5295

Answers (2)

Kavis
Kavis

Reputation: 98

Update the GA to version 4. It will work.

Upvotes: 2

Larry Schiefer
Larry Schiefer

Reputation: 15775

Lollipop enforces a security restriction that you cannot call startService(), stopService() or bindService() with implicit Intents. In order for this to work on Lollipop, update your code to specify the ComponentName in the Intent.

Upvotes: 4

Related Questions