android-getting-started-samples icon indicating copy to clipboard operation
android-getting-started-samples copied to clipboard

Unable to start receiver CdsReceiver. Not allowed to start service Intent. Android 8.0.

Open relaxedSoul opened this issue 7 years ago • 9 comments

Hello!

In the latest version of Android OS, The App is not allowed to perform usual background work we used to do before. So, in the result, when you start that CdsService, sometimes the App is in the background and the error occurs.

Please, fix the issue.

The message from Fabric.io:

Fatal Exception: java.lang.RuntimeException Unable to start receiver com.adobe.creativesdk.aviary.internal.cds.CdsReceiver: java.lang.IllegalStateException: Not allowed to start service Intent { act=aviary.intent.action.CDS_DOWNLOAD_START cmp=com.drive2/com.adobe.creativesdk.aviary.internal.cds.CdsService (has extras) }: app is in background uid UidRecord{fb5a8ae u0a121 RCVR idle procs:1 seq(0,0,0)}

It happens somewhere there:

com.adobe.creativesdk.aviary.internal.cds.CdsReceiver.handlePackageReplaced (SourceFile:123) com.adobe.creativesdk.aviary.internal.cds.CdsReceiver.onReceive (SourceFile:103)

Libraries' versions:

com.adobe.creativesdk.foundation:auth:0.9.1251 com.adobe.creativesdk:image:4.8.4

relaxedSoul avatar Oct 13 '17 10:10 relaxedSoul

Any updates on this @relaxedSoul ?

RTimal avatar Jan 16 '18 05:01 RTimal

@RTimal still get crashes on the active devices sometimes. Nothing changed.

relaxedSoul avatar Jan 16 '18 09:01 relaxedSoul

Issue on Android 8.0 and above:


java.lang.RuntimeException: 
 
  at android.app.ActivityThread.handleReceiver (ActivityThread.java:3399)
 
  at android.app.ActivityThread.-wrap18 (Unknown Source)
 
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1780)
 
  at android.os.Handler.dispatchMessage (Handler.java:105)
 
  at android.os.Looper.loop (Looper.java:164)
 
  at android.app.ActivityThread.main (ActivityThread.java:6940)
 
  at java.lang.reflect.Method.invoke (Native Method)
 
  at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:327)
 
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1374)

Caused by: java.lang.IllegalStateException: 
 
  at android.app.ContextImpl.startServiceCommon (ContextImpl.java:1538)
 
  at android.app.ContextImpl.startService (ContextImpl.java:1484)
 
  at android.content.ContextWrapper.startService (ContextWrapper.java:663)
 
  at android.content.ContextWrapper.startService (ContextWrapper.java:663)
 
  at com.adobe.creativesdk.aviary.internal.cds.CdsReceiver.handlePackageReplaced (CdsReceiver.java:123)
 
  at com.adobe.creativesdk.aviary.internal.cds.CdsReceiver.onReceive (CdsReceiver.java:103)
 
  at android.app.ActivityThread.handleReceiver (ActivityThread.java:3392)

Getting this crash very frequently even after updating to the version -

compile 'com.adobe.creativesdk.foundation:auth:0.9.2006-5'  
compile 'com.adobe.creativesdk:image:4.8.4'

avishkar2k avatar May 22 '18 12:05 avishkar2k

I'm experiencing the very same problem and found a migration article that states to remove the CDS Service because the SDK is now responsible for this operations.

Here is the article: https://creativesdk.zendesk.com/hc/en-us/articles/211241666-Android-migration-guide-from-0-9-7-to-0-9-1062

Seishin avatar Jun 20 '18 05:06 Seishin

Update

The above solution shared by me is not working. Every time the app has been updated - this crashes starts popping up... I don't know how could be handled by us...

Seishin avatar Jun 27 '18 13:06 Seishin

Hello,

Having the same issue any updates on this?

Thanks!

leokho avatar Jul 30 '18 08:07 leokho

Try removing this part

Intent cdsIntent = AdobeImageIntent.createCdsInitIntent(getBaseContext(), "CDS");
startService(cdsIntent);

superandrew213 avatar Aug 11 '18 16:08 superandrew213

@superandrew213 where is this intent?

Seishin avatar Sep 06 '18 07:09 Seishin

@Seishin unfortunately that won't fix it. The issue is with the background thread.

Maybe there is a way to catch and silence this exception?

superandrew213 avatar Dec 10 '18 04:12 superandrew213