Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gif not working under Android #5

Open
msrockswell opened this issue Nov 21, 2023 · 11 comments
Open

Gif not working under Android #5

msrockswell opened this issue Nov 21, 2023 · 11 comments

Comments

@msrockswell
Copy link

Description

Gif (Animation) not working under Android. iOS worked

Steps to Reproduce

<maui:CachedImage
Source="spinner.gif">

Expected Behavior

Actual Behavior

Basic Information

  • Version with issue: FFImageLoading.Maui 1.0.3
  • Platform: Android

Screenshots

Reproduction Link / Code

@microspaze
Copy link
Owner

microspaze commented Feb 5, 2024

@msrockswell can you upload the gif image? Or you can create a sample demo which can reproduce this issue. I have test the Sample.Droid demo in the source code, it works.

@msrockswell
Copy link
Author

@microspaze thanks for your answer. Which NET version are you using with your Sample.Droid demo?

@microspaze
Copy link
Owner

Sample.Droid demo can be run on both net7.0-* and net8.0-*.

@Pantheas
Copy link

Pantheas commented Feb 9, 2024

I'm having the same issue using FFImageLoading.Maui 1.0.8 and NET8.
The GIF is shown and animated properly on iOS, however not visible at all on Android.

Should I provide a sample repo?

@microspaze
Copy link
Owner

@Pantheas & @msrockswell Maybe your project's targeting android api is too old. Which version of android api do you use in your project? You can try to update the android api version to try if this issue is fixed.

@Pantheas
Copy link

I'm targeting API level 34 with a minimum API level of 29

@microspaze
Copy link
Owner

MauiGifApp.zip

@Pantheas & @msrockswell Can you test the MauiGifApp demo? I still can't reproduce your problem.

@Pantheas
Copy link

Pantheas commented Mar 2, 2024

I only get the error the first time the page is loaded.
I will test the MauiGifApp demo in the upcoming days for sure!
Feel free to take a look at the exception stack trace:

[DOTNET] Image loading failed: documents_sorting.gif
[DOTNET] System.AggregateException: One or more errors occurred. (The operation was canceled.) (The operation was canceled.) (documents_sorting.gif)
[DOTNET]  ---> System.OperationCanceledException: The operation was canceled.
[DOTNET]    at System.Threading.CancellationToken.ThrowOperationCanceledException()
[DOTNET]    at System.Threading.CancellationToken.ThrowIfCancellationRequested()
[DOTNET]    at FFImageLoading.DataResolvers.ResourceDataResolver.Resolve(String identifier, TaskParameter parameters, CancellationToken token)
[DOTNET]    at FFImageLoading.DataResolvers.FallbackDataResolver.Resolve(String identifier, TaskParameter parameters, CancellationToken token)
[DOTNET]    --- End of inner exception stack trace ---
[DOTNET]    at FFImageLoading.DataResolvers.FallbackDataResolver.Resolve(String identifier, TaskParameter parameters, CancellationToken token)
[DOTNET]    at FFImageLoading.DataResolvers.WrappedDataResolver.Resolve(String identifier, TaskParameter parameters, CancellationToken token)
[DOTNET]    at FFImageLoading.Work.ImageLoaderTask`3.<RunAsync>d__88[[Android.Graphics.Bitmap, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065],[FFImageLoading.Drawables.SelfDisposingBitmapDrawable, FFImageLoading.Maui, Version=5.0.0.0, Culture=neutral, PublicKeyToken=null],[Android.Widget.ImageView, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065]].MoveNext()
[DOTNET]  ---> (Inner Exception #1) System.OperationCanceledException: The operation was canceled.
[DOTNET]    at System.Threading.CancellationToken.ThrowOperationCanceledException()
[DOTNET]    at System.Threading.CancellationToken.ThrowIfCancellationRequested()
[DOTNET]    at FFImageLoading.DataResolvers.BundleDataResolver.Resolve(String identifier, TaskParameter parameters, CancellationToken token)
[DOTNET]    at FFImageLoading.DataResolvers.FallbackDataResolver.Resolve(String identifier, TaskParameter parameters, CancellationToken token)<---
[DOTNET] 
[DOTNET]  ---> (Inner Exception #2) System.IO.FileNotFoundException: documents_sorting.gif
[DOTNET]    at FFImageLoading.DataResolvers.FileDataResolver.Resolve(String identifier, TaskParameter parameters, CancellationToken token)
[DOTNET]    at FFImageLoading.DataResolvers.FallbackDataResolver.Resolve(String identifier, TaskParameter parameters, CancellationToken token)<---

@microspaze
Copy link
Owner

@Pantheas it seems you put the documents_sorting.gif in a wrong folder or the gif file's build action is not MauiImage. Can you double check its placement and build action?

@Pantheas
Copy link

Pantheas commented Mar 5, 2024

documents_sorting.gif is placed in /Resources/Images/ with BuildAction set to MauiImage.
I only face loading issues for the very first time on app startup. If I e.g. implement a delay of 10 seconds, the animation would show up because there is a retry after some time.
Also, when I select a different filter that forces a reloading of the list and triggers the UI to show the loading animation, it is display aswell.

@msrockswell
Copy link
Author

msrockswell commented Apr 4, 2024

Now it works on .NET 7. NuGet Update 1.1.3 & csproj None Remove gif. Thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants