facebook / fresco

An Android library for managing images and the memory they use.
https://frescolib.org/
MIT License
17.08k stars 3.75k forks source link

Fatal Exception: java.lang.NoClassDefFoundError #2812

Open hysapp opened 2 weeks ago

hysapp commented 2 weeks ago

Fatal Exception: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/graphics/ColorSpace; at com.facebook.imageutils.ImageMetaData.getColorSpace(ImageMetaData.java:12) at com.facebook.imagepipeline.image.EncodedImage.readImageMetaData(EncodedImage.java:421) at com.facebook.imagepipeline.image.EncodedImage.internalParseMetaData(EncodedImage.java:380) at com.facebook.imagepipeline.image.EncodedImage.parseMetaData(EncodedImage.java:357) at com.facebook.imagepipeline.producers.NetworkFetchProducer.notifyConsumer(NetworkFetchProducer.java:187) at com.facebook.imagepipeline.producers.NetworkFetchProducer.handleFinalResult(NetworkFetchProducer.java:167) at com.facebook.imagepipeline.producers.NetworkFetchProducer.onResponse(NetworkFetchProducer.java:114) at com.facebook.imagepipeline.producers.NetworkFetchProducer$1.onResponse(NetworkFetchProducer.java:75) at com.facebook.imagepipeline.backends.okhttp3.OkHttpNetworkFetcher$fetchWithRequest$2.onResponse(OkHttpNetworkFetcher.java:146) at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519) 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)

Caused by java.lang.ClassNotFoundException: Didn't find class "android.graphics.ColorSpace" on path: DexPathList[[zip file "/data/app/com.hyapp.chat.dating.messenger-1/base.apk"],nativeLibraryDirectories=[/data/app/com.hyapp.chat.dating.messenger-1/lib/arm, /data/app/com.hyapp.chat.dating.messenger-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]] 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.facebook.imageutils.ImageMetaData.getColorSpace(ImageMetaData.java:12) at com.facebook.imagepipeline.image.EncodedImage.readImageMetaData(EncodedImage.java:421) at com.facebook.imagepipeline.image.EncodedImage.internalParseMetaData(EncodedImage.java:380) at com.facebook.imagepipeline.image.EncodedImage.parseMetaData(EncodedImage.java:357) at com.facebook.imagepipeline.producers.NetworkFetchProducer.notifyConsumer(NetworkFetchProducer.java:187) at com.facebook.imagepipeline.producers.NetworkFetchProducer.handleFinalResult(NetworkFetchProducer.java:167) at com.facebook.imagepipeline.producers.NetworkFetchProducer.onResponse(NetworkFetchProducer.java:114) at com.facebook.imagepipeline.producers.NetworkFetchProducer$1.onResponse(NetworkFetchProducer.java:75) at com.facebook.imagepipeline.backends.okhttp3.OkHttpNetworkFetcher$fetchWithRequest$2.onResponse(OkHttpNetworkFetcher.java:146) at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519) 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)

Sorg666 commented 5 days ago

I think it is caused by proguard/r8 optimizations. In this case you can add these lines to your proguard-rules file

-keep public class com.facebook.imageutils.** {
   public *;
}