java.lang.NoClassDefFoundError when Fresco.initialize(this)
See original GitHub issueDescription
Hi, I have created a simple project https://github.com/shinwan2/SimpleFrescoApp. At master
branch, running the app will trigger a crash on Fresco.initialize(this)
.
Here is the relevant stacktrace
java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/util/Pools$SynchronizedPool;
at com.facebook.imagepipeline.core.ImagePipelineFactory.buildPlatformDecoder(ImagePipelineFactory.java:337)
at com.facebook.imagepipeline.core.ImagePipelineFactory.getPlatformDecoder(ImagePipelineFactory.java:356)
at com.facebook.imagepipeline.core.ImagePipelineFactory.getPlatformBitmapFactory(ImagePipelineFactory.java:319)
at com.facebook.imagepipeline.core.ImagePipelineFactory.getAnimatedFactory(ImagePipelineFactory.java:163)
at com.facebook.imagepipeline.core.ImagePipelineFactory.getImageDecoder(ImagePipelineFactory.java:222)
at com.facebook.imagepipeline.core.ImagePipelineFactory.getProducerFactory(ImagePipelineFactory.java:372)
at com.facebook.imagepipeline.core.ImagePipelineFactory.getProducerSequenceFactory(ImagePipelineFactory.java:402)
at com.facebook.imagepipeline.core.ImagePipelineFactory.getImagePipeline(ImagePipelineFactory.java:279)
at com.facebook.drawee.backends.pipeline.PipelineDraweeControllerBuilderSupplier.<init>(PipelineDraweeControllerBuilderSupplier.java:51)
at com.facebook.drawee.backends.pipeline.PipelineDraweeControllerBuilderSupplier.<init>(PipelineDraweeControllerBuilderSupplier.java:42)
at com.facebook.drawee.backends.pipeline.PipelineDraweeControllerBuilderSupplier.<init>(PipelineDraweeControllerBuilderSupplier.java:35)
at com.facebook.drawee.backends.pipeline.Fresco.initializeDrawee(Fresco.java:96)
at com.facebook.drawee.backends.pipeline.Fresco.initialize(Fresco.java:85)
at com.facebook.drawee.backends.pipeline.Fresco.initialize(Fresco.java:38)
Reproduction
Please checkout to master
branch, compile, and run in emulator or Android device.
Solution
Fresco (com.facebook.imagepipeline
) needs additional dependency to android.support.v4.util.Pools.SynchronizedPool
which based on this should be in com.android.support:support-compat:28.0.0
.
Additional Information
- Fresco version: 1.11.0
- Platform version: Android Emulator API 27
Related with #2194
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
android - java.lang.NoClassDefFoundError: com.facebook ...
I'm trying to use Fresco but it crashes as soon as I try to initialize it. I use Android Studio and I've been...
Read more >java.lang.NoClassDefFoundError when Fresco.initialize(this)
java.lang.NoClassDefFoundError when Fresco.initialize(this) 问题描述: 使用fresco,implementati...
Read more >HUAWEI PE-CL00 4.4 版本报错定位在application 的Fresco ...
java.lang.NoClassDefFoundError: com.facebook.imagepipeline.producers.HttpUrlConnectionNetworkFetcher at com.facebook.imagepipeline.core.
Read more >Adding Flipper to Android apps with Gradle
To set up Flipper for Android, you need to add the necessary dependencies to your app, initialize the Flipper client and enable the...
Read more >lg.java - 麻豆.apk源代码分析 - 摸瓜
te.u(a, "Fresco has already been initialized! `Fresco.initialize(...)` should only be called 1 single time to avoid memory leaks!");. } else {. c =...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I started getting this error with fresco
1.14.0
and1.14.1
. I had addedimplementation 'com.facebook.fresco:fresco:1.+'
to fix images not loading with React Native0.59.8
. The+
started picking up these new versions that aren’t in the changelog. It appears that v1.14.0 migrated to androidx https://github.com/facebook/fresco/compare/b59414a97b6fc37269985f6d8b111b756fc42464...v1.14.0.Downgrading to
1.13.0
withimplementation 'com.facebook.fresco:fresco:1.13.0'
fixed it for now. Once React Native0.60.0
lands with androidx support, hopefully the newer versions will work too.Please enable Jetifier as mentioned above if you hit this issue. Thanks @JesseBuss for the solution.