maui icon indicating copy to clipboard operation
maui copied to clipboard

.Net MAUI 7 Android, Image Gif Animation Not Playing in Release Mode, Normal in Debug Mode

Open syachrodi opened this issue 2 years ago • 39 comments
trafficstars

Description

I tried to release the .net maui apps that I made, when in debug mode everything works fine, but the problem occurs when I release my application to Android, the gif image that I use for loading doesn't work properly, no animation is playing, it only displays the native image.

Then I tried to make a simple application to confirm this problem, and yes, the problem remains the same, here I attach the simple code that I made, where this coding runs normally in debug mode, but in release mode the gif animation doesn't play

Steps to Reproduce

The simple code

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="MiCetApp.View.StartPage"
             Title="StartPage"
             BackgroundColor="#6789ba"
             Shell.NavBarIsVisible="False">
    <Grid
        RowDefinitions="*, Auto, Auto">
        <Image
            HeightRequest="150"
            Source="{Binding StringFormat=Resources/Images/loading_animation}"
            IsAnimationPlaying="False"
            x:Name="gifAnimation"/>

        <Button
            Grid.Row="1"
            Text="Play Animation"
            Clicked="PlayAnimation"/>

        <Button
            Grid.Row="2"
            Text="Pause Animation"
            Clicked="PauseAnimation"/>
    </Grid>
</ContentPage>


private void PlayAnimation(object sender, EventArgs e)
    {
        gifAnimation.IsAnimationPlaying = true;
    }

    private void PauseAnimation(object sender, EventArgs e)
    {
        gifAnimation.IsAnimationPlaying = false;
    }

Version with bug

6.0.312

Last version that worked well

6.0.312

Affected platforms

Android, I was not able test on other platforms

Affected platform versions

Android 11.0 API 31.0

Did you find any workaround?

No response

Relevant log output

No response

syachrodi avatar Jan 28 '23 09:01 syachrodi

Hey there, can you put up a repo?

NonameMissingNo avatar Jan 28 '23 19:01 NonameMissingNo

Hey there, can you put up a repo?

Hi @NonameMissingNo this's my example repo https://github.com/syachrodi/MiCetApp

syachrodi avatar Jan 29 '23 10:01 syachrodi

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

ghost avatar Jan 30 '23 15:01 ghost

I also encountered the same problem, which urgently needs to be solved!

hg15671855182 avatar Mar 16 '23 02:03 hg15671855182

Is there any workaround to this issue, please?

rfangzh avatar Mar 23 '23 09:03 rfangzh

Works neither on IOS nor Android

fariz-huseynov avatar Apr 10 '23 23:04 fariz-huseynov

not work on iOS and Android +1

ea543 avatar Apr 12 '23 15:04 ea543

I was able to resolve by simply doing this

protected override async void OnAppearing() { base.OnAppearing(); await Task.Delay(100); BreatheImageLoader.IsAnimationPlaying = false; await Task.Delay(100); BreatheImageLoader.IsAnimationPlaying = true; }

sheharyarshahid avatar May 04 '23 21:05 sheharyarshahid

I was able to resolve by simply doing this

protected override async void OnAppearing() { base.OnAppearing(); await Task.Delay(100); BreatheImageLoader.IsAnimationPlaying = false; await Task.Delay(100); BreatheImageLoader.IsAnimationPlaying = true; }

Has been try in release mode?

syachrodi avatar May 05 '23 01:05 syachrodi

protected async override void OnAppearing() { base.OnAppearing(); await Task.Delay(100); imgLoader.IsAnimationPlaying = false; await Task.Delay(100); imgLoader.IsAnimationPlaying = true; }

I did the same thing and it works fine in Debug but does not work in Release.

jmc5018 avatar May 05 '23 13:05 jmc5018

anyone solve this problem ?

xufeitt avatar May 23 '23 06:05 xufeitt

no2023年5月23日 14:25,xufeitt @.***>寫道: anyone solve this problem ?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

ea543 avatar May 23 '23 12:05 ea543

no@@

ea543 avatar May 24 '23 07:05 ea543

Any fix?

Buryyy avatar Jun 11 '23 17:06 Buryyy

Verified this on Visual Studio Enterprise 17.7.0 Preview 2.0. Repro on Android emulator (13.0-API 33) and iOS 16.4 with below Project: MauiApp14.zip Screenshot: image

AnnYang01 avatar Jun 19 '23 09:06 AnnYang01

Been watching this one since March hoping it would get fixed before my app release but doesn't look like it's been started yet. I know you guys have your hands full with others issues but this does seem like basic functionality that should get fixed. Any update on when a fix for this might go out? Thank you MAUI team.

ecosimini avatar Jun 20 '23 01:06 ecosimini

Hi, https://gist.github.com/jamesmontemagno/7619563 If you are looking same implementation in MAUI. Please visit below GitHub link

Gif Animation Sample

umeshkamble avatar Jul 17 '23 16:07 umeshkamble

thanks,It`s workaround for me.

ea543 avatar Jul 18 '23 06:07 ea543

@umeshkamble I got excited when I saw this but tried it out and it doesn't work for Android release builds :( GetDataAsync is only supported for ios and maccatalyst. Is there any similar method that would work for Android?

ecosimini avatar Jul 19 '23 12:07 ecosimini

I think playing GIFs is a basic feature, but I struggled to figure it out in maui, which is ridiculous! To this day, there is still no good way to solve this problem

Vito258 avatar Oct 30 '23 06:10 Vito258

I think playing GIFs is a basic feature, but I struggled to figure it out in maui, which is ridiculous! To this day, there is still no good way to solve this problem

It looks like MAUI is abandoned. No one cares about basic features and performance of applications on different platforms.

Rameron avatar Oct 30 '23 15:10 Rameron

The playback of GIFs is a basic function. The ticket is almost 1 year old already. When will the problem be fixed?

msrockswell avatar Nov 24 '23 12:11 msrockswell

The playback of GIFs is a basic function. The ticket is almost 1 year old already. When will the problem be fixed?

yes from umeshkamble Gif Animation Sample

ea543 avatar Nov 27 '23 04:11 ea543

2024 is just around the corner and this issue is still not fixed. 👎🏻

echolumaque avatar Dec 07 '23 15:12 echolumaque

I've experimented with using WebView to play a GIF in MAUI, it works on Android and iOS, on Windows I use the native support because it seems to work fine and I didn't want to troubleshoot what was going wrong with the WebView on Windows. I'm working on building out a sample, but if anyone needs something sooner let me know. What I don't have working yet is to honor HeightRequest or WidthRequest and other layout options

billreiss avatar Dec 08 '23 00:12 billreiss

umeshkamble Gif Animation Sample The gif is played much too slowly.

With FFImageLoading works under iOS. Android doesn't work.

Does anyone know a Nuget alternative to ffimageloading?

msrockswell avatar Dec 08 '23 09:12 msrockswell

How is such a basic feature still not fixed... 😆

Buryyy avatar Dec 08 '23 09:12 Buryyy

Using WebView to animate GIF on iOS and Android https://github.com/billreiss/MauiGifWebView

billreiss avatar Dec 13 '23 15:12 billreiss

When will the problem be fixed?

dora-emo avatar Jan 12 '24 07:01 dora-emo

@billreiss : Nice Workaround for NET8.

I need a Workaround for NET7. Does anyone know a example?

msrockswell avatar Jan 16 '24 15:01 msrockswell