Open karthikraja-arumugam opened 1 year ago
Hi @karthikraja-arumugam. We have added the "s/try-latest-version" label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version.
You can install the latest version by installing the latest Visual Studio (Preview) with the .NET MAUI workload installed. If the issue still persists, please let us know with any additional details and ideally a reproduction project provided through a GitHub repository.
This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
I've checked in the latest version too, still facing the same issue.
@karthikraja-arumugam could you specify what you mean with "latest version"?
Hi @karthikraja-arumugam. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
@jfversluis, I'm facing this issue with version 7.0.86. Please check the video.
https://github.com/dotnet/maui/assets/92788387/bda086b4-0a12-4412-8421-099e21562f75
We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.
I have also came across same problem.
<Image Source="{Binding SVImageSource}"/>
SVImageSource = ImageSource.FromStream(() => response);
As @karthikraja-arumugam showed, image is not visible initially but when screen orientation changes, image shows up.
@jfversluis Is there any suggested workaround on this one?
I have this same behavior, but I think in my case it is caused by the fact that the Source url is answered with a 301 Moved. However I do not know how I can make this image control follow the redirect on iOs like it is doing on android. Help is welcome.
I think in my case it is caused by the fact that the Source url is answered with a 301 Moved.
I solved my problem. I think it was not entirely the same as described. The redirect was from an ip adres to a domain both without ssl. This was solved by adding
<key>NSAppTransportSecurity</key> etc...
in the iOs plist. More on this can be found here.
I am facing the same issue for my project. Has someone managed to find a workaround?
I am getting this error simply by binding a Uri to the Source of an Image in a CollectionView. NSAppTransportSecurity does not help, as this Url is https:// but also, hosted on a valid AWS CDN that returns the image in any browser on/off the device. Works on Android, so it is IOS platform specific issue. Using the latest version of everything .NET 8.0; I do not see this issue in other components within the app, just the landing page where a CollectionView of images is loading, using MVVM
Microsoft.Maui.Controls.UriImageSource: Warning: Error getting stream for https://d39bv8qyr14eas.cloudfront.net/b7106340-29f1-4476-b545-9ed29ce42582/ea48232b-68de-4677-a810-4fbf83ae670a.png
System.TimeoutException: The request timed out.
---> System.Threading.Tasks.TaskCanceledException: A task was canceled.
at System.Net.Http.NSUrlSessionHandler.NSUrlSessionDataTaskStream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/Foundation/NSUrlSessionHandler.cs:line 1377
--- End of inner exception stack trace ---
at System.Net.Http.NSUrlSessionHandler.NSUrlSessionDataTaskStream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/Foundation/NSUrlSessionHandler.cs:line 1381
at System.IO.Stream.<CopyToAsync>g__Core|27_0(Stream source, Stream destination, Int32 bufferSize, CancellationToken cancellationToken)
at System.Net.Http.HttpContent.LoadIntoBufferAsyncCore(Task serializeToStreamTask, MemoryStream tempBuffer)
at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
at Microsoft.Maui.Controls.StreamWrapper.GetStreamAsync(Uri uri, CancellationToken cancellationToken, HttpClient client)
at Microsoft.Maui.Controls.UriImageSource.DownloadStreamAsync(Uri uri, CancellationToken cancellationToken)
[19:16:24 WRN] Error getting stream for "https://d39bv8qyr14eas.cloudfront.net/b7106340-29f1-4476-b545-9ed29ce42582/ea48232b-68de-4677-a810-4fbf83ae670a.png"
System.TimeoutException: The request timed out.
---> System.Threading.Tasks.TaskCanceledException: A task was canceled.
at System.Net.Http.NSUrlSessionHandler.NSUrlSessionDataTaskStream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/Foundation/NSUrlSessionHandler.cs:line 1377
--- End of inner exception stack trace ---
at System.Net.Http.NSUrlSessionHandler.NSUrlSessionDataTaskStream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/Foundation/NSUrlSessionHandler.cs:line 1381
at System.IO.Stream.<CopyToAsync>g__Core|27_0(Stream source, Stream destination, Int32 bufferSize, CancellationToken cancellationToken)
at System.Net.Http.HttpContent.LoadIntoBufferAsyncCore(Task serializeToStreamTask, MemoryStream tempBuffer)
at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
at Microsoft.Maui.Controls.StreamWrapper.GetStreamAsync(Uri uri, CancellationToken cancellationToken, HttpClient client)
at Microsoft.Maui.Controls.UriImageSource.DownloadStreamAsync(Uri uri, CancellationToken cancellationToken)
Description
In image control, if we bind stream or URI image source, it does not load into the view upon initial loading. However, if any layout changes occur, the image loads correctly.
Steps to Reproduce
iOS
MAC
Set the proper local image in ViewModel.
Run the sample on Mac and repeat the steps, you will get the same result as iOS.
ImageBindingSample.zip
Link to public reproduction project repository
https://github.com/KarthikRajaAKR/Samples/tree/main/ImageBindingSample
Version with bug
7.0.49
Last version that worked well
Unknown/Other
Affected platforms
iOS, macOS
Affected platform versions
MacOS Ventura v13.0.1, iOS 14
Did you find any workaround?
No
Relevant log output
No response