反应原生壁画崩溃

时间:2017-09-08 08:28:07

标签: react-native fresco

在Samsung S6 Active上加载图像时出现此问题 我试图保持proguard,multidex,bla ... bla ......但是没有工作

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)

2 个答案:

答案 0 :(得分:7)

将react-native升级到0.49.5之后我遇到了这个问题,我可以通过将android/app/build.gradle中的壁画依赖项更新为:

来修复它
compile 'com.facebook.fresco:animated-base-support:1.3.0'
compile 'com.facebook.fresco:animated-gif:1.3.0'

这是相关的主题,但不是建议的1.0.1,只有1.3.0似乎有效。

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

答案 1 :(得分:0)

即使正确设置了multidex,我也遇到了同样的问题。

对我来说,是将它添加到app / build.gradle的android闭包中:

dexOptions {
    preDexLibraries = false
}