facebook / facebook/fresco

Fresco.initialize caused Application Not Responding

Open
#2,771 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
17.2k
Forks
3.7k
PR merge metrics
No merged PRs in 30d

Description

### Description

While executing a code on below line it is producing ANR. ANR's are reported on Crashlytics
We are facing ANR while initializing the liabrary as

```
fun init() {
Fresco.initialize(application, imagePipelineConfig)
}
```

Below is the ANR report from Crashlytics:
at java.util.concurrent.CancellationException.(CancellationException.java:61)
at com.facebook.imagepipeline.core.ImagePipeline.(ImagePipeline.java)
at com.facebook.imagepipeline.core.ImagePipelineFactory.createImagePipeline(ImagePipelineFactory.java:309)
at com.facebook.imagepipeline.core.ImagePipelineFactory.getImagePipeline(ImagePipelineFactory.java:303)
at com.facebook.drawee.backends.pipeline.PipelineDraweeControllerBuilderSupplier.(PipelineDraweeControllerBuilderSupplier.java:55)
at com.facebook.drawee.backends.pipeline.PipelineDraweeControllerBuilderSupplier.(PipelineDraweeControllerBuilderSupplier.java:45)
at com.facebook.drawee.backends.pipeline.PipelineDraweeControllerBuilderSupplier.(PipelineDraweeControllerBuilderSupplier.java:38)
at com.facebook.drawee.backends.pipeline.Fresco.initializeDrawee(Fresco.java:121)
at com.facebook.drawee.backends.pipeline.Fresco.initialize(Fresco.java:110)
at com.facebook.drawee.backends.pipeline.Fresco.initialize(Fresco.java:54)
at com.facebook.drawee.backends.pipeline.Fresco.initialize(Fresco.java:46)
at com.myapp.framework.fresco.FrescoManager.init(FrescoManager.java:13)
at com.myapp.FrescoInitializer.create(FrescoInitializer.kt:17)
at com.myapp.FrescoInitializer.create(FrescoInitializer.kt:10)
at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:180)

### Reproduction

It is an online ANR, I can't reproduce it on my phone, however it happens for multiple users.

### Solution

N/A

### Additional Information

* Fresco version: 2.5.0
* Platform version: Android version 11, 12, 13 Devices: HMD Global, Motorola, Google Cros, Oneplus, Samsung and other

Contributor guide

Open the contributing guide

Research direction

Start with the Fresco.initialize path named in the trace: Fresco.java, PipelineDraweeControllerBuilderSupplier.java, ImagePipelineFactory.java, and ImagePipeline.java, then review how AppInitializer reaches FrescoInitializer.create. Compare that path with the Crashlytics ANR report; done means identifying a reproducible cause or a validated way to prevent the initialization ANR across the reported Android environments.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.