解决--No instance field forceOldAnimationCode of type Z in class ImageDecodeOptions
2017-07-18 15:22
459 查看
项目最近有个需求,需要增加动图功能。目前支持动图的图片加载框架一个是Glide,一个是Fresco。动手写Demo时,发现用Fresco加载Gif图片时报了下面的错。在官方issue上面找到了这个问题的原因,原来是我使用的Fresco版本问题。forceOldAnimationCode这个属性已经被移除了,所以找不到了。
解决办法:确保引入的所有Fresco相关的库的版本号都是一样的。
附上官方issue链接:
https://github.com/facebook/fresco/issues/1660
7-18 15:11:20.297 14207-14358/com.example.huanglin.dynamicimagedemo E/AndroidRuntime: FATAL EXCEPTION: Thread-24794
Process: com.example.huanglin.dynamicimagedemo, PID: 14207
java.lang.NoSuchFieldError: No instance field forceOldAnimationCode of type Z in class Lcom/facebook/imagepipeline/common/ImageDecodeOptions; or its superclasses (declaration of ‘com.facebook.imagepipeline.common.ImageDecodeOptions’ appears in/data/app/com.example.huanglin.dynamicimagedemo-1/base.apk)
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.DefaultImageDecoder1.decode(DefaultImageDecoder.java:65)atcom.facebook.imagepipeline.decoder.DefaultImageDecoder.decode(DefaultImageDecoder.java:126)atcom.facebook.imagepipeline.producers.DecodeProducerProgressiveDecoder.doDecode(DecodeProducer.java:240)
at com.facebook.imagepipeline.producers.DecodeProducerProgressiveDecoder.access200(DecodeProducer.java:112)
at com.facebook.imagepipeline.producers.DecodeProducerProgressiveDecoder1.run(DecodeProducer.java:145)
at com.facebook.imagepipeline.producers.JobScheduler.doJob(JobScheduler.java:207)
at com.facebook.imagepipeline.producers.JobScheduler.access000(JobScheduler.java:27)atcom.facebook.imagepipeline.producers.JobScheduler1.run(JobScheduler.java:78)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutorWorker.run(ThreadPoolExecutor.java:588)atcom.facebook.imagepipeline.core.PriorityThreadFactory1.run(PriorityThreadFactory.java:43)
at java.lang.Thread.run(Thread.java:833)
解决办法:确保引入的所有Fresco相关的库的版本号都是一样的。
附上官方issue链接:
https://github.com/facebook/fresco/issues/1660
7-18 15:11:20.297 14207-14358/com.example.huanglin.dynamicimagedemo E/AndroidRuntime: FATAL EXCEPTION: Thread-24794
Process: com.example.huanglin.dynamicimagedemo, PID: 14207
java.lang.NoSuchFieldError: No instance field forceOldAnimationCode of type Z in class Lcom/facebook/imagepipeline/common/ImageDecodeOptions; or its superclasses (declaration of ‘com.facebook.imagepipeline.common.ImageDecodeOptions’ appears in/data/app/com.example.huanglin.dynamicimagedemo-1/base.apk)
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.DefaultImageDecoder1.decode(DefaultImageDecoder.java:65)atcom.facebook.imagepipeline.decoder.DefaultImageDecoder.decode(DefaultImageDecoder.java:126)atcom.facebook.imagepipeline.producers.DecodeProducerProgressiveDecoder.doDecode(DecodeProducer.java:240)
at com.facebook.imagepipeline.producers.DecodeProducerProgressiveDecoder.access200(DecodeProducer.java:112)
at com.facebook.imagepipeline.producers.DecodeProducerProgressiveDecoder1.run(DecodeProducer.java:145)
at com.facebook.imagepipeline.producers.JobScheduler.doJob(JobScheduler.java:207)
at com.facebook.imagepipeline.producers.JobScheduler.access000(JobScheduler.java:27)atcom.facebook.imagepipeline.producers.JobScheduler1.run(JobScheduler.java:78)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutorWorker.run(ThreadPoolExecutor.java:588)atcom.facebook.imagepipeline.core.PriorityThreadFactory1.run(PriorityThreadFactory.java:43)
at java.lang.Thread.run(Thread.java:833)
相关文章推荐
- 二、Java.lang.NoSuchFieldError: No static field xxx of type I in class Lcom/XX/R$id; or
- Android java.lang.NoSuchFieldError: No static field xxx of type I in class Lcom/XX/R$id; or its superclasses
- java.lang.NoSuchFieldError: No static field ib_back of type I in class Lcom/example/demo/R$id; or
- java.lang.NoSuchFieldError: No static field txt_content of type I in class Lcom/test/
- java.lang.NoSuchFieldError: No static field xxx of type I in class Lcom/XX/R$id; or its superclasses
- java.lang.NoSuchFieldError: No static field xxx of type I in class Lcom/XX/R$id; or its superclasses
- NoSuchFieldError: No static field btn_press3 of type I in class Lcom/hyphenate/helpdesk/R$id; or its
- No static field ll_time of type I in class L使用第三方类库R文件不编译
- java.lang.NoSuchFieldError: No static field xxx of type I in class Lcom/XX/R$id; or its superclasses
- Java解决No enclosing instance of type PrintListFromTailToHead is accessible问题
- No converter found for return value of type: class org.json.JSONArray解决方法
- java:No enclosing instance of type Classname is accessible. Must qualify the allocation
- java解决 No enclosing instance of type XXX is accessible的问题
- 关于java.lang.IllegalArgumentException: No converter found for return value of type: class 的问题解决
- 解决java.lang.IllegalArgumentException: No converter found for return value of type: class java.util
- Java解决No enclosing instance of type PrintListFromTailToHead is accessible问题的两种方案
- PHP错误Cannot use object of type stdClass as array in错误的解决办法
- 问题No enclosing instance of type E is accessible的解决
- 再学Java 之 解决No enclosing instance of type * is accessible
- 解决android出现static void xxx No enclosing instance of type xxx is accessible