Xamarin.forms: Xamarin Forms - Image Control not loading remote images in iOS

Created on 20 May 2020  ·  7Comments  ·  Source: xamarin/Xamarin.Forms

_This issue has been moved from a ticket on Developer Community._


[regression] [worked-in:16.4]
In today’s WTF has randomly been broken;

Image controls won’t load images from a URL source in iOS:

<Image x:Name="MyImage" Source=“https://img-prod-cms-rt-microsoft-com.akamaized.net/cms/api/am/imageFileData/RE1MmB8?ver=6c43g”/>

This also no longer works:

MyImage.Source = ImageSource.FromUri(new Uri("https://img-prod-cms-rt-microsoft-com.akamaized.net/cms/api/am/imageFileData/RE1MmB8?ver=6c43g"));

And this also doesn't work any more:

MyImage.Source = "https://img-prod-cms-rt-microsoft-com.akamaized.net/cms/api/am/imageFileData/RE1MmB8?ver=6c43g";

It does work in Android. It did work in VS 16.4.

This is a work-around:

var client = new System.Net.Http.HttpClient();
System.IO.Stream imagestream = await client.GetStreamAsync("https://img-prod-cms-rt-microsoft-com.akamaized.net/cms/api/am/imageFileData/RE1MmB8?ver=6c43g");
MyImage.Source = ImageSource.FromStream(() => imagestream);
--- ### Original Comments #### Visual Studio Feedback System on 5/7/2020, 11:14 PM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.


Original Solutions

(no solutions)

image iOS 🍎 needs-info ❓ needs-repro ❔ unverified bug

All 7 comments

I confirm this bug.. and the frustration that gave me during 2 days not being able to solve this,

Here is my shorter form workarround:

foto.Source = ImageSource.FromStream(() => new MemoryStream(new WebClient().DownloadData(url)));

What version of Xamarin.Forms are you using? This looks like the bug we fixed in 4.5.0 with https://github.com/xamarin/Xamarin.Forms/pull/9682.

fixed it by upgrading Xamarin.Forms and Xamarin.iOS thank you! Now works on iOS 13.5

Great to hear! We were just as flabbergasted when this bug appeared. We hadn't touched the offending code in years. Turns out, async is hard. 😂 Thanks for confirming!

This is still happening to me (latest xamarin.forms, iOS 14), and vsfeedback workaround still works, but I'd rather not do it like that 😅

I am also reproducing this on Xamarin.Forms 14.

This bug is still alive, remote images are not loading on IOS 14

Was this page helpful?
0 / 5 - 0 ratings