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.

MvxCachedImageView error loading in a listview

See original GitHub issue

Description

I have a MvxCachedImageView in a listview. There is an intermittent error in loading picture that result in loading the ErrorPlaceholder. It could happen:

  1. in a list of 10 rows, starting from the middle, say the 7th row
  2. after bind the listview to a new data source. the 1st row may get the error immediately

This is the code of the image view

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:local="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal">

  <ffimageloading.cross.MvxCachedImageView
      android:id="@+id/mvxCachedImageView_picture"
      android:layout_width="@dimen/listitem_route_picture_image_size"
      android:layout_height="@dimen/listitem_route_picture_image_size"
      android:layout_marginBottom="4dp"
      android:layout_marginStart="8dp"
      android:layout_marginTop="4dp"
      local:MvxBind="LoadingPlaceholderImagePath 'res:ic_image_grey_700_48dp.png'; ErrorPlaceholderImagePath 'res:ic_error_outline_grey_700_48dp.png'; Transformations Transformations; DownsampleWidth DownsampleWidth; DownsampleUseDipUnits true; ImagePath PicturePath"
      local:layout_constraintStart_toStartOf="parent"
      local:layout_constraintTop_toTopOf="parent" />

Pictures are 100% ok as they can be shown in the same listview sometimes without any error.

From the debug output, there is an error

W/BitmapFactory( 8153): bitmap marked for reuse (2433600 bytes) can't fit new bitmap (3244800 bytes)
03-25 20:34:56.703 D/skia    ( 8153): --- decoder->decode returned false

The debug output is attached. ffimageloading error log 2.txt

Is there any other parameter that can be used to solve it?

Thanks,

Nick

Steps to Reproduce

Expected Behavior

Actual Behavior

Basic Information

  • Version with issue:
  • Last known good version:
  • Platform:

Screenshots

Reproduction Link / Code

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
Nick1611commented, Apr 29, 2018

Hi Daniel,

With the latest version, it is still happening but the frequency is lower.

As mentioned in my last post, I have 2 recyclers where the second one is full screen. I found that if the second one downsample rate is not large enough, i.e. loading with large memory, the recycler is fine but all subsequent operations of the loader will become unstable. It includes after returned to the first recycler without transformation, and code loading thumbnail. After specified a much lower sample size, it is smooth.

Thanks,

Nick

0reactions
daniel-luberdacommented, Apr 24, 2018

That issue should be fixed in 2.3.6 with: https://github.com/luberda-molinet/FFImageLoading/commit/1a650f2086fcf7d10e350cab9b3602601f9fe809

Do you still experience it?

Transformations are resource hungry operations, so may lead to OOM exceptions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Crash on Xamarin Forms ListView with CachedImage ...
I have a list of about 100 objects all with an image loaded asynchronously with the forms:CachedImage XAML property. The ListView has the ......
Read more >
Xamarin Forms (Xaml) ListView not displaying images
Xamarin Forms (testing on Android) The first image displays fine. The very same image in the ListView does not display. Ultimately I will...
Read more >
Xamarin forms list view of many dynamically created images
Hi, I have a simple list view with a data template containing an image element and I'm binding a list of items to...
Read more >
load image xamarin - Microsoft Q&A
Here is the error I got when I want load an image in xamarin. Image Loading: Image failed to load: E_NETWORK_ERROR
Read more >
Getting Started with Xamarin ListView (SfListView)
The known Framework issue in UWP platform is the custom controls will not render when deployed the application in Release Mode . The...
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