React native Fresco crash

1.7k Views Asked by At

I got this problem when load image on Samsung S6 Active I tried to keep proguard, multidex, bla...bla... but not working

java.lang.NoClassDefFoundError: Failed resolution of:
Lcom/facebook/imagepipeline/memory/PooledByteBuffer;
at com.facebook.imagepipeline.animated.factory.AnimatedImageFactoryImpl.decodeGif(AnimatedImageFactoryImpl.java:84)
at com.facebook.imagepipeline.decoder.DefaultImageDecoder.decodeGif(DefaultImageDecoder.java:145)
at com.facebook.imagepipeline.decoder.DefaultImageDecoder$1.decode(DefaultImageDecoder.java:65)
at com.facebook.imagepipeline.decoder.DefaultImageDecoder.decode(DefaultImageDecoder.java:126)
at com.facebook.imagepipeline.producers.DecodeProducer$ProgressiveDecoder.doDecode(DecodeProducer.java:240)
at com.facebook.imagepipeline.producers.DecodeProducer$ProgressiveDecoder.access$200(DecodeProducer.java:112)
at com.facebook.imagepipeline.producers.DecodeProducer$ProgressiveDecoder$1.run(DecodeProducer.java:145)
at com.facebook.imagepipeline.producers.JobScheduler.doJob(JobScheduler.java:207)
at com.facebook.imagepipeline.producers.JobScheduler.access$000(JobScheduler.java:27)
at com.facebook.imagepipeline.producers.JobScheduler$1.run(JobScheduler.java:78)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at com.facebook.imagepipeline.core.PriorityThreadFactory$1.run(PriorityThreadFactory.java:43)
at java.lang.Thread.run(Thread.java:762)
3

There are 3 best solutions below

0
On

I had the same issue even with multidex properly set up.

What did it for me was to add this in the android closure in app/build.gradle:

dexOptions {
    preDexLibraries = false
}
1
On

I had this problem after upgrading react-native to 0.49.5 and I was able to fix it by updating my dependencies for fresco in android/app/build.gradle to:

compile 'com.facebook.fresco:animated-base-support:1.3.0'
compile 'com.facebook.fresco:animated-gif:1.3.0'

Here is the related thread but instead of the suggested 1.0.1 only 1.3.0 seemed to work.

https://github.com/facebook/react-native/issues/13345

0
On

Just Downgrade Version

compile 'com.facebook.fresco:animated-gif:2.0.0'