Open Phantom-KNA opened 3 months ago
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-android'">
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.6" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.6" />
<PackageReference Include="CommunityToolkit.Maui" Version="7.0.1" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' != 'net8.0-android'">
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.14" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.14" />
<PackageReference Include="CommunityToolkit.Maui" Version="8.0.1" />
</ItemGroup>
This way it works fine for Android, I couldn't tell if the error is in CommunityToolkit.Maui or in recent versions of Microsoft.Maui.Controls. On Windows it works fine regardless of which version is used, other platforms have not been tested.
While I appreciate the reproduction it's still a bit too big and adding a lot of noise making it hard to see what the actual cause of this might be. If you take out all the plugins and such does it still show this behavior? We really want to determine if this is something that originates in .NET MAUI or not. If not, there is not much we can do about it unfortunately.
One approach might be to just create a File > New MAUI project and start adding bits from this project until you hit the bug. That way you will have a good overview of the moving parts that show this behavior.
While I appreciate the reproduction it's still a bit too big and adding a lot of noise making it hard to see what the actual cause of this might be. If you take out all the plugins and such does it still show this behavior? We really want to determine if this is something that originates in .NET MAUI or not. If not, there is not much we can do about it unfortunately.
One approach might be to just create a File > New MAUI project and start adding bits from this project until you hit the bug. That way you will have a good overview of the moving parts that show this behavior.
Fine, not problem, thanks for your time.
<CollectionView
x:Name="List">
<CollectionView.ItemsLayout>
<GridItemsLayout HorizontalItemSpacing="5" Orientation="Horizontal" />
</CollectionView.ItemsLayout>
<CollectionView.ItemTemplate>
<DataTemplate>
<Image WidthRequest="100" Source="{Binding .}" />
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
List<string> enlaces = new List<string>()
{
"https://image.tmdb.org/t/p/w92/iLa15KURiosRmvtWP6vKqBT11Le.jpg",
"https://image.tmdb.org/t/p/w92/zS8BSQdbOesql0EWbs17kPvLoAT.jpg",
"https://image.tmdb.org/t/p/w92/wmnVOIaTsGcRpZ9rLv2msbtqi3C.jpg",
"https://image.tmdb.org/t/p/w92/cboUHkM1zA7m3SaCrf6dW5jGqqW.jpg",
"https://image.tmdb.org/t/p/w92/blq050GHBt0Fzx1j9FvohaEuknJ.jpg",
"https://image.tmdb.org/t/p/w92/diEeiB2DmZZadHISkg24RO2n0rT.jpg",
"https://image.tmdb.org/t/p/w92/8fzJZQhmkLyZeXdZUi1eE2ZKhkm.jpg",
"https://image.tmdb.org/t/p/w92/6tJWxRfBKWGIPFkfLTod2CgCexU.jpg",
"https://image.tmdb.org/t/p/w92/pxkPdKscFFSNoSoROLYIgxcz8of.jpg",
"https://image.tmdb.org/t/p/w92/9rk0NJXs1izgJPZwbkSrkiVFWMQ.jpg",
"https://image.tmdb.org/t/p/w92/9pHFhxo1inS9EeupN9QIDuUWmGm.jpg",
"https://image.tmdb.org/t/p/w92/fSY6BYUZMObTIzPfRBlhuAb5lsd.jpg",
"https://image.tmdb.org/t/p/w92/6cKzsWfDtGj5BMHi1dN9EkGz4lJ.jpg",
"https://image.tmdb.org/t/p/w92/lMZWF6Bm8MkFHjL9PHgUzHuuYfi.jpg",
"https://image.tmdb.org/t/p/w92/fRaBjht3S1HU6lJrz2SoFwwOZQM.jpg",
"https://image.tmdb.org/t/p/w92/yJTk4eqQd9Yo5REpFbTSOMkbSgn.jpg",
"https://image.tmdb.org/t/p/w92/q35kdC8ci9Fm2gVQazJdsohtGpD.jpg",
"https://image.tmdb.org/t/p/w92/tskjJSuOk1U8moEkCOPtetGTpFe.jpg",
"https://image.tmdb.org/t/p/w92/ncKCQVXgk4BcQV6XbvesgZ2zLvZ.jpg",
"https://image.tmdb.org/t/p/w92/syKwepJwzvoYhPLBfUy4YYSrstr.jpg"
};
While I appreciate the reproduction it's still a bit too big and adding a lot of noise making it hard to see what the actual cause of this might be. If you take out all the plugins and such does it still show this behavior? We really want to determine if this is something that originates in .NET MAUI or not. If not, there is not much we can do about it unfortunately.
One approach might be to just create a File > New MAUI project and start adding bits from this project until you hit the bug. That way you will have a good overview of the moving parts that show this behavior.
I have been doing some tests, apparently there are some performance errors in my design, but the strange thing is that in a version prior to Microsoft.Maui.Controls 8.0.6 it works perfectly fine, this appears with 8.0.14
@jfversluis After version 8.0.6 this error starts, I tried 8.0.7, 8.0.10 and 8.0.14. It is worth noting that this occurs in CollectionView. Can used this XAML for auto log error, Use a Grid or VerticalLayout for put this collectionviews:
<CollectionView
x:Name="List1"
Margin="0,0,0,0">
<CollectionView.ItemsLayout>
<GridItemsLayout HorizontalItemSpacing="{OnPlatform Android=0, WinUI=5}" Orientation="Horizontal" />
</CollectionView.ItemsLayout>
<CollectionView.ItemTemplate>
<DataTemplate>
<Grid
Margin="15,0,0,0"
ColumnSpacing="100"
WidthRequest="{OnPlatform Android=100,
WinUI=150}">
<Grid.RowDefinitions>
<RowDefinition Height="{OnPlatform Android=150, WinUI=250}" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Border
Grid.Row="0"
Margin="0,0,0,0"
Stroke="Transparent"
StrokeThickness="0">
<Border.StrokeShape>
<RoundRectangle CornerRadius="10" />
</Border.StrokeShape>
<Image
Margin="0,0,0,0"
Aspect="AspectFill"
BackgroundColor="{AppThemeBinding Light={StaticResource White},
Dark={StaticResource Black},
Default={StaticResource Black}}"
Source="{Binding .}" />
</Border>
<Border
Margin="10,10,0,0"
BackgroundColor="#E21221"
HeightRequest="20"
HorizontalOptions="Start"
Stroke="#FB101D"
VerticalOptions="Start"
WidthRequest="30">
<Border.StrokeShape>
<RoundRectangle CornerRadius="5" />
</Border.StrokeShape>
<Label
FontSize="10"
HorizontalOptions="Center"
Text="5.0"
TextColor="White"
VerticalOptions="Center" />
</Border>
<Label
Grid.Row="1"
Margin="0,0,0,0"
FontSize="12"
HorizontalOptions="Center"
HorizontalTextAlignment="Center"
Text="Movie 1"
TextColor="{AppThemeBinding Light={StaticResource Black},
Dark={StaticResource White},
Default={StaticResource Black}}"
VerticalOptions="Start" />
<VisualStateManager.VisualStateGroups>
<VisualStateGroupList>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal">
<VisualState.Setters>
<Setter Property="Opacity" Value="1" />
<Setter Property="BackgroundColor" Value="Transparent" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Selected">
<VisualState.Setters>
<Setter Property="Opacity" Value="0.5" />
<Setter Property="BackgroundColor" Value="Transparent" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</VisualStateManager.VisualStateGroups>
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
<CollectionView
x:Name="List2"
Margin="0,0,0,0">
<CollectionView.ItemsLayout>
<GridItemsLayout HorizontalItemSpacing="{OnPlatform Android=0, WinUI=5}" Orientation="Horizontal" />
</CollectionView.ItemsLayout>
<CollectionView.ItemTemplate>
<DataTemplate>
<Grid
Margin="15,0,0,0"
ColumnSpacing="100"
WidthRequest="{OnPlatform Android=100,
WinUI=150}">
<Grid.RowDefinitions>
<RowDefinition Height="{OnPlatform Android=150, WinUI=250}" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Border
Grid.Row="0"
Margin="0,0,0,0"
Stroke="Transparent"
StrokeThickness="0">
<Border.StrokeShape>
<RoundRectangle CornerRadius="10" />
</Border.StrokeShape>
<Image
Margin="0,0,0,0"
Aspect="AspectFill"
BackgroundColor="{AppThemeBinding Light={StaticResource White},
Dark={StaticResource Black},
Default={StaticResource Black}}"
Source="{Binding .}" />
</Border>
<Border
Margin="10,10,0,0"
BackgroundColor="#E21221"
HeightRequest="20"
HorizontalOptions="Start"
Stroke="#FB101D"
VerticalOptions="Start"
WidthRequest="30">
<Border.StrokeShape>
<RoundRectangle CornerRadius="5" />
</Border.StrokeShape>
<Label
FontSize="10"
HorizontalOptions="Center"
Text="5.0"
TextColor="White"
VerticalOptions="Center" />
</Border>
<Label
Grid.Row="1"
Margin="0,0,0,0"
FontSize="12"
HorizontalOptions="Center"
HorizontalTextAlignment="Center"
Text="Movie 1"
TextColor="{AppThemeBinding Light={StaticResource Black},
Dark={StaticResource White},
Default={StaticResource Black}}"
VerticalOptions="Start" />
<VisualStateManager.VisualStateGroups>
<VisualStateGroupList>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal">
<VisualState.Setters>
<Setter Property="Opacity" Value="1" />
<Setter Property="BackgroundColor" Value="Transparent" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Selected">
<VisualState.Setters>
<Setter Property="Opacity" Value="0.5" />
<Setter Property="BackgroundColor" Value="Transparent" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</VisualStateManager.VisualStateGroups>
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
<CollectionView
x:Name="List3"
Margin="0,0,0,0">
<CollectionView.ItemsLayout>
<GridItemsLayout HorizontalItemSpacing="{OnPlatform Android=0, WinUI=5}" Orientation="Horizontal" />
</CollectionView.ItemsLayout>
<CollectionView.ItemTemplate>
<DataTemplate>
<Grid
Margin="15,0,0,0"
ColumnSpacing="100"
WidthRequest="{OnPlatform Android=100,
WinUI=150}">
<Grid.RowDefinitions>
<RowDefinition Height="{OnPlatform Android=150, WinUI=250}" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Border
Grid.Row="0"
Margin="0,0,0,0"
Stroke="Transparent"
StrokeThickness="0">
<Border.StrokeShape>
<RoundRectangle CornerRadius="10" />
</Border.StrokeShape>
<Image
Margin="0,0,0,0"
Aspect="AspectFill"
BackgroundColor="{AppThemeBinding Light={StaticResource White},
Dark={StaticResource Black},
Default={StaticResource Black}}"
Source="{Binding .}" />
</Border>
<Border
Margin="10,10,0,0"
BackgroundColor="#E21221"
HeightRequest="20"
HorizontalOptions="Start"
Stroke="#FB101D"
VerticalOptions="Start"
WidthRequest="30">
<Border.StrokeShape>
<RoundRectangle CornerRadius="5" />
</Border.StrokeShape>
<Label
FontSize="10"
HorizontalOptions="Center"
Text="5.0"
TextColor="White"
VerticalOptions="Center" />
</Border>
<Label
Grid.Row="1"
Margin="0,0,0,0"
FontSize="12"
HorizontalOptions="Center"
HorizontalTextAlignment="Center"
Text="Movie 1"
TextColor="{AppThemeBinding Light={StaticResource Black},
Dark={StaticResource White},
Default={StaticResource Black}}"
VerticalOptions="Start" />
<VisualStateManager.VisualStateGroups>
<VisualStateGroupList>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal">
<VisualState.Setters>
<Setter Property="Opacity" Value="1" />
<Setter Property="BackgroundColor" Value="Transparent" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Selected">
<VisualState.Setters>
<Setter Property="Opacity" Value="0.5" />
<Setter Property="BackgroundColor" Value="Transparent" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</VisualStateManager.VisualStateGroups>
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
<CollectionView
x:Name="List4"
Margin="0,0,0,0">
<CollectionView.ItemsLayout>
<GridItemsLayout HorizontalItemSpacing="{OnPlatform Android=0, WinUI=5}" Orientation="Horizontal" />
</CollectionView.ItemsLayout>
<CollectionView.ItemTemplate>
<DataTemplate>
<Grid
Margin="15,0,0,0"
ColumnSpacing="100"
WidthRequest="{OnPlatform Android=100,
WinUI=150}">
<Grid.RowDefinitions>
<RowDefinition Height="{OnPlatform Android=150, WinUI=250}" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Border
Grid.Row="0"
Margin="0,0,0,0"
Stroke="Transparent"
StrokeThickness="0">
<Border.StrokeShape>
<RoundRectangle CornerRadius="10" />
</Border.StrokeShape>
<Image
Margin="0,0,0,0"
Aspect="AspectFill"
BackgroundColor="{AppThemeBinding Light={StaticResource White},
Dark={StaticResource Black},
Default={StaticResource Black}}"
Source="{Binding .}" />
</Border>
<Border
Margin="10,10,0,0"
BackgroundColor="#E21221"
HeightRequest="20"
HorizontalOptions="Start"
Stroke="#FB101D"
VerticalOptions="Start"
WidthRequest="30">
<Border.StrokeShape>
<RoundRectangle CornerRadius="5" />
</Border.StrokeShape>
<Label
FontSize="10"
HorizontalOptions="Center"
Text="5.0"
TextColor="White"
VerticalOptions="Center" />
</Border>
<Label
Grid.Row="1"
Margin="0,0,0,0"
FontSize="12"
HorizontalOptions="Center"
HorizontalTextAlignment="Center"
Text="Movie 1"
TextColor="{AppThemeBinding Light={StaticResource Black},
Dark={StaticResource White},
Default={StaticResource Black}}"
VerticalOptions="Start" />
<VisualStateManager.VisualStateGroups>
<VisualStateGroupList>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal">
<VisualState.Setters>
<Setter Property="Opacity" Value="1" />
<Setter Property="BackgroundColor" Value="Transparent" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Selected">
<VisualState.Setters>
<Setter Property="Opacity" Value="0.5" />
<Setter Property="BackgroundColor" Value="Transparent" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</VisualStateManager.VisualStateGroups>
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
Code Behind or ViewModel:
List<string> links = new List<string>()
{
"https://image.tmdb.org/t/p/w92/iLa15KURiosRmvtWP6vKqBT11Le.jpg",
"https://image.tmdb.org/t/p/w92/zS8BSQdbOesql0EWbs17kPvLoAT.jpg",
"https://image.tmdb.org/t/p/w92/wmnVOIaTsGcRpZ9rLv2msbtqi3C.jpg",
"https://image.tmdb.org/t/p/w92/cboUHkM1zA7m3SaCrf6dW5jGqqW.jpg",
"https://image.tmdb.org/t/p/w92/blq050GHBt0Fzx1j9FvohaEuknJ.jpg",
"https://image.tmdb.org/t/p/w92/diEeiB2DmZZadHISkg24RO2n0rT.jpg",
"https://image.tmdb.org/t/p/w92/8fzJZQhmkLyZeXdZUi1eE2ZKhkm.jpg",
"https://image.tmdb.org/t/p/w92/6tJWxRfBKWGIPFkfLTod2CgCexU.jpg",
"https://image.tmdb.org/t/p/w92/pxkPdKscFFSNoSoROLYIgxcz8of.jpg",
"https://image.tmdb.org/t/p/w92/9rk0NJXs1izgJPZwbkSrkiVFWMQ.jpg",
"https://image.tmdb.org/t/p/w92/9pHFhxo1inS9EeupN9QIDuUWmGm.jpg",
"https://image.tmdb.org/t/p/w92/fSY6BYUZMObTIzPfRBlhuAb5lsd.jpg",
"https://image.tmdb.org/t/p/w92/6cKzsWfDtGj5BMHi1dN9EkGz4lJ.jpg",
"https://image.tmdb.org/t/p/w92/lMZWF6Bm8MkFHjL9PHgUzHuuYfi.jpg",
"https://image.tmdb.org/t/p/w92/fRaBjht3S1HU6lJrz2SoFwwOZQM.jpg",
"https://image.tmdb.org/t/p/w92/yJTk4eqQd9Yo5REpFbTSOMkbSgn.jpg",
"https://image.tmdb.org/t/p/w92/q35kdC8ci9Fm2gVQazJdsohtGpD.jpg",
"https://image.tmdb.org/t/p/w92/tskjJSuOk1U8moEkCOPtetGTpFe.jpg",
"https://image.tmdb.org/t/p/w92/ncKCQVXgk4BcQV6XbvesgZ2zLvZ.jpg",
"https://image.tmdb.org/t/p/w92/syKwepJwzvoYhPLBfUy4YYSrstr.jpg"
};
List1.ItemSource = links;
List2.ItemSource = links;
List3.ItemSource = links;
List4.ItemSource = links;
I cannot repro this issue on Visual Studio 17.11.0 Preview 2.1 (8.0.60 & 8.0.14), I created below sample and please correct me if my reproduction steps are wrong, thank you. sample project
The same for Net 8.0.60
@Phantom-KNA Could you provide a sample project for us to investigate it further? And please correct me if my reproduction steps are wrong at your convenience
@Phantom-KNA Could you provide a sample project for us to investigate it further? And please correct me if my reproduction steps are wrong at your convenience
Sorry for some reason I had not seen the messages in this thread, I will check your example repo and confirm, thanks for the time
Description
The loading of images is terrible, this worked quite well in Microsoft.Maui.Controls and Microsoft.Maui.Controls.Compatibility 8.0.6, this log "[FileUtils] err write to mi_exception_log" is repeated over and over again without stopping, causing the performance of the app to degrade.
Steps to Reproduce
Download repo: Change this line:
https://github.com/Phantom-KNA/ImagesBugMaui/blob/139d779efc15062bc930fc6bd41986afa47f9f6a/MainViewModel.cs#L20
by your apikey from TMDBLink to public reproduction project repository
https://github.com/Phantom-KNA/ImagesBugMaui
Version with bug
8.0.7 SR2
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
8.0.6
Affected platforms
Android
Affected platform versions
No response
Did you find any workaround?
Relevant log output