Android-job: Application crash when moved to 1.3.0-9

Created on 2 Jan 2019  路  6Comments  路  Source: evernote/android-job

Following the wiki when I try to include 1.3.0-a9 of this library, I've added the WorkManager dependency as,

implementation 'android.arch.work:work-runtime:1.0.0-beta01';

But I get some crashes with these following logs.

    java.lang.NoSuchFieldError: No static field SUCCESS of type Landroidx/work/ListenableWorker$Result; in class Landroidx/work/ListenableWorker$Result; or its superclasses (declaration of 'androidx.work.ListenableWorker$Result' appears in /data/app/ggg.ffff.sass-1/base.apk)
        at com.evernote.android.job.work.PlatformWorker.doWork(PlatformWorker.java:56)
        at androidx.work.Worker$1.run(Worker.java:84)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
        at java.lang.Thread.run(Thread.java:818)

When I looked upon PlatformWorker , found that the doWork() method inside it tries returning a variable Result.SUCCESS from WorkManager's ListenableRuntime class , but the IDE can't find the definition.

Any suggestions ? A screenshot is attached

untitled

bug

Most helpful comment

All 6 comments

Ok, it's fixed now. I just didn't include the WorkManager in gradle as a dependency.

I have the same problem.

D/PlatformWorker: Run job, request{id=1, tag=PedometerWakeupJob, transient=false}, waited 00:10:30, interval 00:15:00, flex 00:05:00
I/JobExecutor: Executing request{id=1, tag=PedometerWakeupJob, transient=false}, context VhpApplication
D/PedometerWakeupJob: onRunJob()
I/JobExecutor: Finished job{id=1, finished=true, result=SUCCESS, canceled=false, periodic=true, class=PedometerWakeupJob, tag=PedometerWakeupJob}
D/PlatformWorker: Finished job, request{id=1, tag=PedometerWakeupJob, transient=false} SUCCESS
E/AndroidRuntime: FATAL EXCEPTION: pool-1-thread-1
    Process: com.copes.android.dev, PID: 25691
    java.lang.NoSuchFieldError: No field SUCCESS of type Landroidx/work/ListenableWorker$Result; in class Landroidx/work/ListenableWorker$Result; or its superclasses (declaration of 'androidx.work.ListenableWorker$Result' appears in /data/app/com.copes.android.dev-1/split_lib_dependencies_apk.apk:classes86.dex)
        at com.evernote.android.job.work.PlatformWorker.doWork(PlatformWorker.java:56)
        at androidx.work.Worker$1.run(Worker.java:84)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
        at java.lang.Thread.run(Thread.java:760)

But i use regular child class, extends from com.evernote.android.job.Job.
After completion of the job this crash happens.

@AlexKnyazyk Try by just don't including the WorkManager in gradle as a dependency.

I think WorkManager Beta2 is not supported yet. Alpha11 is what was supported in last updated of this library.

Don't use workmanager yet, it is not stable. I use this library, without workmanager, on >1million installs and it works great.

Was this page helpful?
0 / 5 - 0 ratings