Dali icon indicating copy to clipboard operation
Dali copied to clipboard

Failed resolution of: Lcom/jakewharton/disklrucache/DiskLruCache;

Open MarkNjunge opened this issue 6 years ago • 6 comments

~~Might be related to #14~~

Code

Dali.create(this).load(R.drawable.ic_launcher_background).blurRadius(10).into(imgBackground)

Stacktrace

2019-07-26 16:55:46.462 31292-31292/com.marknjunge.blurryshadow E/BlurBuilder: Could not set into imageview
    at.favre.lib.dali.builder.exception.BlurWorkerException: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/jakewharton/disklrucache/DiskLruCache;
        at at.favre.lib.dali.builder.blur.BlurWorker.process(BlurWorker.java:153)
        at at.favre.lib.dali.builder.blur.BlurWorker.call(BlurWorker.java:48)
        at at.favre.lib.dali.builder.blur.BlurWorker.call(BlurWorker.java:27)
        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:764)
     Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/jakewharton/disklrucache/DiskLruCache;
        at at.favre.lib.dali.builder.TwoLevelCache.getDiskCache(TwoLevelCache.java:72)
        at at.favre.lib.dali.builder.TwoLevelCache.getFromDiskCache(TwoLevelCache.java:147)
        at at.favre.lib.dali.builder.TwoLevelCache.get(TwoLevelCache.java:97)
        at at.favre.lib.dali.builder.blur.BlurWorker.process(BlurWorker.java:73)
        at at.favre.lib.dali.builder.blur.BlurWorker.call(BlurWorker.java:48) 
        at at.favre.lib.dali.builder.blur.BlurWorker.call(BlurWorker.java:27) 
        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:764) 
     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.jakewharton.disklrucache.DiskLruCache" on path: DexPathList[[zip file "/data/app/com.marknjunge.blurryshadow-Vc6sW-Lf0gDW7QCdqIz8GA==/base.apk"],nativeLibraryDirectories=[/data/app/com.marknjunge.blurryshadow-Vc6sW-Lf0gDW7QCdqIz8GA==/lib/arm, /data/app/com.marknjunge.blurryshadow-Vc6sW-Lf0gDW7QCdqIz8GA==/base.apk!/lib/armeabi-v7a, /system/lib, /system/vendor/lib]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:169)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at at.favre.lib.dali.builder.TwoLevelCache.getDiskCache(TwoLevelCache.java:72) 
        at at.favre.lib.dali.builder.TwoLevelCache.getFromDiskCache(TwoLevelCache.java:147) 
        at at.favre.lib.dali.builder.TwoLevelCache.get(TwoLevelCache.java:97) 
        at at.favre.lib.dali.builder.blur.BlurWorker.process(BlurWorker.java:73) 
        at at.favre.lib.dali.builder.blur.BlurWorker.call(BlurWorker.java:48) 
        at at.favre.lib.dali.builder.blur.BlurWorker.call(BlurWorker.java:27) 
        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:764) 

MarkNjunge avatar Jul 26 '19 13:07 MarkNjunge

Maybe proguard removed these classes for you, can you check that your config is correct?

patrickfav avatar Jul 28 '19 21:07 patrickfav

Proguard wasn't active.

MarkNjunge avatar Jul 29 '19 04:07 MarkNjunge

This is probably an issue with a newer version of the build tools, as I am currently not an android dev in my professional career I do not follow the latest updates. Any update from somebody else is welcome.

patrickfav avatar Aug 23 '19 10:08 patrickfav

As a workaround you can add the dependency manually to build.gradle

implementation 'com.jakewharton:disklrucache:2.0.2'

diegor2 avatar Jun 12 '20 22:06 diegor2

Since I cannot reproduce this locally, making me think this is specific to your build setup, could you please try v0.4.0 since it was migrated to AndroidX, and maybe jetify broke this for us?

patrickfav avatar Jun 13 '20 21:06 patrickfav

For me it's working fine with Dali 0.4.0 Thanks!

diegor2 avatar Jul 27 '20 22:07 diegor2