question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Images are not shown reliably

See original GitHub issue

Describe the bug If I inflate a layout, add it to a parent view and load an image into image view (one from my resources) I do so empty images every now and then.

E.g. I do create a menu dialog and for simplicity, I do add menu entries manually into a parent list view like following:

// following happens in a loop:
val b = DialogAppItemBinding.inflate(layoutInflater, binding.llRoot, true)
b.ivIcon.loadAny(item.icon) // this is a resource id

Expected behavior The image should always be loaded.

To Reproduce I can’t reproduce it reliably, it happens every now and then… Like in 1-2%

Logs/Screenshots

Version 1.1.1

My used image loader setup looks like following:

fun init(context: Context) {
      imageLoader = ImageLoader.Builder(context)
          .crossfade(false)
          .componentRegistry {
              // Fetchers
              add(AppIconFetcher(context))
              //add(AppIconFetcher2(context))
              // Decoders
              // ...
          }
          .okHttpClient {

              //val cacheDirectory = File(context.cacheDir, "image_cache").apply { mkdirs() }
              //val cacheSize = 250L * 1024 * 1024 // 250MB
              //val cache = Cache(cacheDirectory, cacheSize)

              OkHttpClient.Builder()
                  .cache(CoilUtils.createDefaultCache(context))
                  .build()
          }
          .apply {
              // Enable logging to the standard Android log if this is a debug build.
              if (BuildConfig.DEBUG) {
                  //logger(DebugLogger(Log.VERBOSE))
              }
          }
          // Workaround wegen issue: https://github.com/coil-kt/coil/issues/567
          .bitmapPoolingEnabled(false)
          //.launchInterceptorChainOnMainThread(false)
          .build()
      Coil.setImageLoader(imageLoader)
  }

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
MFlisarcommented, Jun 7, 2021

I run my test project with 1.2.2 and it looks really good - I can’t reproduce the issue anymore in ~200 runs. Thanks

0reactions
colinrtwhitecommented, Jun 4, 2021

@MFlisar I just pushed 1.2.2 which includes a fix for a race condition that could cause this issue. Can you let me know if you’re still seeing the issue on the latest version?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Images not showing up reliably in List on iOS 16 #1988
1), KFImage s frequently fail to show up when used inside List / ForEach . We're using them as part of a more...
Read more >
Why Are My Images Not Showing Up in Figma?
There are a few potential reasons why Figma might not be displaying images correctly. First, ensure that the image is hosted on a...
Read more >
If My Photo Stream isn't updating
Learn what to do if photos aren't showing up in My Photo Stream on your iPhone, iPad, iPod touch, Mac, or Apple TV....
Read more >
Can't Upload Images to WordPress Media Library?
If your Media Library is loading but not showing images, there are two primary causes: an incompatible plugin, and improper file permissions ......
Read more >
The Reliability of Image Representation - Spreadys.blog
Misunderstanding, incorrect handling, poor analysis and biased presentation will put innocent people behind bars. It's not CCTV's fault! Second.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found