0

Please see the XAML code below:

    <Image Source="http://192.168.1.91:32786/api/Images/5c60f693-bef5-e088-a485-80ee7300c695"/>

When run the Android Emulator on my Windows PC, then the image appears. However when I run the Android emulator on my MAC, then the image does no appear. Please note that I have tried multiple emulators on both mahnes and the result is the same. Why is this?

So far I have tried:

1) Browsing to the image in the web browser, which works. 2) Launch the Android Emulator on a Windows PC and the image appears in the Android application. It does not appear in the Android application when I launch the Android emulator from the Mac. I am using the same emulator (Marshmellow on each PC). 3) I have tried different emulators on both machines and the results are the same.

w0051977
  • 15,099
  • 32
  • 152
  • 329
  • 1
    firewall or any of a thousand networking related issues. Have you done anything to try and debug it? – Jason Oct 09 '19 at 21:26
  • @Jason the image url runs on the mac, so if it was down to a firewall issue then I would expect to see it from windows rather than mac. – w0051977 Oct 09 '19 at 21:32
  • Using different API level emulators? As you have to configure `cleartextTrafficPermitted` in order to use `http`: https://stackoverflow.com/a/55997456/4984832 – SushiHangover Oct 09 '19 at 21:33
  • @SushiHangover, thanks. Is that specific to mac. The image runs when the emulator is run on windows. – w0051977 Oct 09 '19 at 21:42
  • @w0051977 Is the emulator API-level image the same? Can you load the image in the emulator's browser? Does `logcat` show any errors? – SushiHangover Oct 09 '19 at 21:43
  • are you running debug builds on both? have you tried loading the url in the emulator's browser? – Jason Oct 09 '19 at 22:06
  • @Jason, I have just added what I have tried to the question. – w0051977 Oct 10 '19 at 09:03
  • Can you try to download that image from the url to see if there is any Exception throw? – nevermore Oct 10 '19 at 09:35
  • @Jack Hua - MSFT, how would I know if an exception is thrown? The image is requested directly from the view. Thanks. – w0051977 Oct 10 '19 at 09:43
  • I mean [download it](https://stackoverflow.com/questions/41337487/how-to-download-image-from-url-and-save-it-to-a-local-sqlite-database). – nevermore Oct 10 '19 at 09:45
  • @Jack Hua, it works if I do as you have suggested. – w0051977 Oct 11 '19 at 05:56
  • Then it should work, don't know what happened on your side when you use Source to load the image. – nevermore Oct 11 '19 at 08:19
  • @Jack Hua, I am wandering if it could be down to what amirvenus says here: https://forums.xamarin.com/discussion/119404/images-not-showing-in-xf-osx-project. I don't have access to my MAC at the moment but will later. – w0051977 Oct 11 '19 at 08:22
  • Well, you can have a try later. – nevermore Oct 11 '19 at 08:23
  • Does it work when deployed to a phone? – Atif Nov 04 '19 at 19:01

0 Answers0