Swrve / swrve-android-sdk

Swrve Android SDK
http://www.swrve.com
Other
10 stars 18 forks source link

doInBackground crash #295

Closed nimeacuerdo closed 3 years ago

nimeacuerdo commented 4 years ago

Hello,

We have been seen a spike in crashes in our app but only for Android 9 and 10 users and for a couple of days (apparently, a push to the whole customers base was sent at the time), with a stacktrace like the following...

java.lang.RuntimeException: An error occurred while executing doInBackground()
        at android.os.AsyncTask$4.done(AsyncTask.java:399)
        at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
        at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
        at java.util.concurrent.FutureTask.run(FutureTask.java:271)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:919)

Caused by: java.lang.IllegalArgumentException: Given work is not active: JobWorkItem{id=1 intent=Intent { (has extras) } dcount=4}
        at android.app.job.JobParameters.completeWork(JobParameters.java:273)
        at androidx.core.app.JobIntentService$JobServiceEngineImpl$WrapperWorkItem.complete(JobIntentService:268)
        at androidx.core.app.JobIntentService$CommandProcessor.doInBackground(JobIntentService:394)
        at androidx.core.app.JobIntentService$CommandProcessor.doInBackground(JobIntentService:383)
        at android.os.AsyncTask$3.call(AsyncTask.java:378)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:919)

The app with those crashes is using swrve-firebase, version 6.3.0.

It looks like Swrve is the only SDK we use that internally depends on JobIntentService as in https://github.com/Swrve/swrve-android-sdk/blob/6.3.0/SwrveSDKCommon/src/main/java/android/support/v4/app/SwrveJobIntentService.java

At first, it looked similar to #282 but we are already using the version that included the fix for that issue, so... any ideas?

Maybe related to https://issuetracker.google.com/issues/63622293.

Regards, David

nimeacuerdo commented 4 years ago

Hi there!

davidbreenwex commented 4 years ago

Hi David,

I've not seen this error reported before and there is not much useful information in that stacktrace. Are you able to reproduce this issue?

Also are you sure there are no other libraries depending on that JobIntentService? You could run ./gradlew dependencies to check if there are others.

It may be best to create a support ticket by emailing support@swrve.com so we can help debug this issue.

Best, David

Sergio-Mira commented 3 years ago

Hi @nimeacuerdo, since 7.4.0 we are now using the work manager and not services so this problem should hopefully be resolved. Let us know how it goes.