Android-job: NoClassDefFoundError: Failed resolution of: Lcom/evernote/android/job/JobRescheduleService

Created on 19 Sep 2017  路  20Comments  路  Source: evernote/android-job

On API 5.1, getting this error.

compile 'com.evernote:android-job:1.2.0-RC4'

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/evernote/android/job/JobRescheduleService; at com.evernote.android.job.JobManager.<init>(JobManager.java:159) at com.evernote.android.job.JobManager.create(JobManager.java:112) at com.xxx.xxx.App.onCreate(App.java:20) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1017) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4858) at de.robv.android.xposed.XposedBridge.invokeOriginalMethodNative(Native Method) at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:334) at android.app.ActivityThread.handleBindApplication(<Xposed>) at android.app.ActivityThread.access$1500(ActivityThread.java:178) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1531) at android.os.Handler.dispatchMessage(Handler.java:111) at android.os.Looper.loop(Looper.java:194) at android.app.ActivityThread.main(ActivityThread.java:5637) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:959) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:754) at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:102) Caused by: java.lang.ClassNotFoundException: Didn't find class "com.evernote.android.job.JobRescheduleService" on path: DexPathList[[zip file "/data/app/com.xxx.xxx-2/base.apk"],nativeLibraryDirectories=[/data/app/com.xxx.xxx-2/lib/arm64, /vendor/lib64, /system/lib64]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) at java.lang.ClassLoader.loadClass(ClassLoader.java:511) at java.lang.ClassLoader.loadClass(ClassLoader.java:469) at com.evernote.android.job.JobManager.<init>(JobManager.java:159)聽 at com.evernote.android.job.JobManager.create(JobManager.java:112)聽 at com.xxx.xxx.App.onCreate(App.java:20)聽 at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1017)聽 at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4858)聽 at de.robv.android.xposed.XposedBridge.invokeOriginalMethodNative(Native Method)聽 at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:334)聽 at android.app.ActivityThread.handleBindApplication(<Xposed>)聽 at android.app.ActivityThread.access$1500(ActivityThread.java:178)聽 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1531)聽 at android.os.Handler.dispatchMessage(Handler.java:111)聽 at android.os.Looper.loop(Looper.java:194)聽 at android.app.ActivityThread.main(ActivityThread.java:5637)聽 at java.lang.reflect.Method.invoke(Native Method)聽 at java.lang.reflect.Method.invoke(Method.java:372)聽 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:959)聽 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:754)聽 at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:102)聽 Suppressed: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/app/JobIntentService; at dalvik.system.DexFile.defineClassNative(Native Method) at dalvik.system.DexFile.defineClass(DexFile.java:226) at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:219) at dalvik.system.DexPathList.findClass(DexPathList.java:321) at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:54) ... 20 more Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.app.JobIntentService" on path: DexPathList[[zip file "/data/app/com.xxx.xxx-2/base.apk"],nativeLibraryDirectories=[/data/app/com.xxx.xxx-2/lib/arm64, /vendor/lib64, /system/lib64]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) at java.lang.ClassLoader.loadClass(ClassLoader.java:511) at java.lang.ClassLoader.loadClass(ClassLoader.java:469) ... 25 more Suppressed: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.app.JobIntentService" on path: DexPathList[[dex file "/data/dalvik-cache/xposed_XResourcesSuperClass.dex"],nativeLibraryDirectories=[/vendor/lib64, /system/lib64]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) at java.lang.ClassLoader.loadClass(ClassLoader.java:511) at java.lang.ClassLoader.loadClass(ClassLoader.java:504) ... 26 more Suppressed: java.lang.ClassNotFoundException: android.support.v4.app.JobIntentService at java.lang.Class.classForName(Native Method) at java.lang.BootClassLoader.findClass(ClassLoader.java:781) at java.lang.BootClassLoader.loadClass(ClassLoader.java:841) at java.lang.ClassLoader.loadClass(ClassLoader.java:504) ... 27 more Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available Suppressed: java.lang.ClassNotFoundException: Didn't find class "com.evernote.android.job.JobRescheduleService" on path: DexPathList[[dex file "/data/dalvik-cache/xposed_XResourcesSuperClass.dex"],nativeLibraryDirectories=[/vendor/lib64, /system/lib64]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) at java.lang.ClassLoader.loadClass(ClassLoa.....

needs info

All 20 comments

Please provide a sample so that I can reproduce the issue in the emulator. From the logs I see that this device is using Xposed...

I am using config multiDexEnabled true in gradle file, I was able to reproduce it in the Emulator too

I think it boils down to android studio not being able to Refference android.support.v4.app.jobintentservice in JobRescheduleService.java

If 'JobIntentService' cannot be referenced than check your dependencies and see which support library version is used at runtime.
'JobIntentService' is supported since version 26.0.0

I see Xposed framework in your log. Whenever I see it in any crash reports for my app I usually ignore the crash report. Xposed interferes with the proper functioning of android APIs and I have spent many hours chasing bugs just to bump into Xposed being the culprit. I wonder if if is here as well?

compilesdk = 25
This might be the issue, any fix for this?
@DvTonder I was able to reproduce it inside emulator too and other android devices too not just rooted devices

Yes, you should use compile SDK 26.

I really want the DailyJob helper class implementation but it might not be the right time for switching to 26 for my app. Can this be done on api 25?

I don't think so. The new library will rely on the support library 26. And the support library requires compile SDK 26 as far as I know. But the DailyJob class is basically a standalone helper, you can copy the source and it should also work with the old library.

You can compile with 26 and has target = 25, it should work

Hi
Is it possible to use v1.2.0 of library without using support-v4:26.+ ?
I ask because I get the error message posted in this issue when I exclude support-v4 from library in gradle.

No, that's not possible.

Does using v1.1.11 cause any problem on android 8? I use it for running some periodic jobs which runs every x hours or x days.

@Merka84 I have been using v1.1.12 on Oreo without any known troubles. As suggested by @vRallev there is a helper class DailyJob in v1.2 which I copied over and used. works fine for my use case.

@thisismohitgupta
Thanks for your comment.
Do you use it for running any periodic job , similar to mine?

@Merka84 most probably yes

@thisismohitgupta
Would you please tell me how to copy and use DailyJob in my code?

@thisismohitgupta & @vRallev I tried using DailyJob Helper class with v1.1.12 but It is giving various issues like

  • 'isTransient()' is not public in 'com.evernote.android.job.JobRequest'. Cannot be accessed from outside package
  • Cannot resolve symbol 'JobConfig'
  • Cannot reslove method addExtras
  • 'getRequest()' is not public in 'com.evernote.android.job.Job.Params'. Cannot be accessed from outside package
  • Cannot resolve method 'createBuilder'

I'm sorry, you're on your own and need to address these lines yourself. I'm only supporting the DailyJob class inside of version 1.2.0 and recommend to use SDK 26 instead.

@thisismohitgupta can you tell me how are you using DailyJob Helper class with lower version of library.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

karntrehan picture karntrehan  路  5Comments

SwiftyWang picture SwiftyWang  路  7Comments

froesmatheus picture froesmatheus  路  4Comments

jsu4650 picture jsu4650  路  5Comments

ExploiTR picture ExploiTR  路  6Comments