maui icon indicating copy to clipboard operation
maui copied to clipboard

Android: Specific Avif image fails to load

Open armanimichael opened this issue 1 year ago • 10 comments

Description

Hello, I'm having a peculiar issue where a very specific image is not loading in on Android.

  • Avif format
  • Other Avif format images do work correctly
  • Converting the image to other formats "fixes" the issue, although this is not an actionable solution
  • Regardless of URI / File source type.

By digging into this a bit, it looks like Glide is failing to load the image. Yet, there's nothing suggesting why this is happening.

From the sample project, you'll see how there's simply a blank space where the image is supposed to be: Screenshot 2024-06-27 at 14 37 01

Steps to Reproduce

No response

Link to public reproduction project repository

https://github.com/armanimichael/maui-image-sample

Version with bug

8.0.61 SR6.1

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

No response

Did you find any workaround?

No

Relevant log output

No response

armanimichael avatar Jun 27 '24 12:06 armanimichael

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

github-actions[bot] avatar Jun 27 '24 12:06 github-actions[bot]

I can repro this issue at Android platform on the latest 17.11.0 Preview 2.1(8.0.61).

RoiChen001 avatar Jun 28 '24 06:06 RoiChen001

I've opened an issue on the appropriate repository to add the NuGet package for AVIF support. When available also remember about: https://github.com/bumptech/glide/issues/5140#issuecomment-1550067008

albyrock87 avatar Aug 05 '24 09:08 albyrock87

@armanimichael @albyrock87

Does AVIF work on other platofrms?

moljac avatar Aug 06 '24 13:08 moljac

@moljac on iOS it does work, I have to information regarding other platforms

albyrock87 avatar Aug 06 '24 13:08 albyrock87

@armanimichael @albyrock87

Are you sure that just by adding new package this will be resolved?

moljac avatar Aug 06 '24 14:08 moljac

@moljac unfortunately I couldn't try this due to the missing NuGet package.

I'll try to see if I can create a java app in order to verify this.

My assumption is simply based on Glide's documentation. To fix this issue we need the NuGet and then we have to modify the Gradle configuration so that Glide "sees" that plugin. Automatic plugin loading is also explained in Glide docs.

albyrock87 avatar Aug 06 '24 19:08 albyrock87

@moljac unfortunately I couldn't try this due to the missing NuGet package.

No. No. There is no nuget. Sorry for confusion

I'll try to see if I can create a java app in order to verify this.

Please do not waste your time. I created new bindings, but dependecy package is using some crazy versioning format which is not SemVer 2 nor Nuget legacy, so I need to fix tooling 1st.

My assumption is simply based on Glide's documentation. To fix this issue we need the NuGet and then we have to modify the Gradle configuration so that Glide "sees" that plugin.

This "seeing" part worries me. There is no Gradle when using nuget package. Hopefully we don't have to add too much. We'll see after bindings are ready.

Automatic plugin loading is also explained in Glide docs.

Plugin in Maven usually indicates that MSBuild tasks (tricks and hacks) will be needed.

moljac avatar Aug 07 '24 07:08 moljac

@albyrock87

NuGet package has been published:

https://www.nuget.org/packages/Xamarin.Android.Glide.AVIF.Integration

Tried adding nuget package, but did not work.

Repro sample[s]:

Archive.zip

moljac avatar Oct 18 '24 10:10 moljac

PR created

https://github.com/dotnet/maui/pull/25376

moljac avatar Oct 18 '24 10:10 moljac

@armanimichael @albyrock87

Nuget was published and I created PR https://github.com/dotnet/maui/pull/25376 that should fix this issue, but (as always) does not work.

I am working on native android minimal repro sample to see if there is something else needed. Namely I am afraid we might also need

https://mvnrepository.com/artifact/com.github.bumptech.glide/compiler

But not 100% sure.

In the PR there is also sample code

src/Controls/samples/Controls.Sample.Sandbox/MainPage.xaml

with images from your sample.

Nuget is added to the Core

src/Core/src/Core.csproj

thanks

moljac avatar Oct 29 '24 21:10 moljac