CreativeSDK / android-getting-started-samples

Getting started guides and sample code for the Adobe Creative SDK for Android
63 stars 33 forks source link

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

Open relaxedSoul opened 6 years ago

relaxedSoul commented 6 years ago

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

RTimal commented 6 years ago

Any updates on this @relaxedSoul ?

relaxedSoul commented 6 years ago

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

avishkar2k commented 6 years ago

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'
Seishin commented 6 years ago

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 commented 6 years ago

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...

leokho commented 6 years ago

Hello,

Having the same issue any updates on this?

Thanks!

superandrew213 commented 6 years ago

Try removing this part

Intent cdsIntent = AdobeImageIntent.createCdsInitIntent(getBaseContext(), "CDS");
startService(cdsIntent);
Seishin commented 6 years ago

@superandrew213 where is this intent?

superandrew213 commented 5 years ago

@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?