question

PrasanthKumar-9388 avatar image
0 Votes"
PrasanthKumar-9388 asked JarvanZhang-MSFT edited

Xamarin Forms - Images fetching from URL is not displaying in Android

I'm trying to fetch an image from the URL for my Xamarin Forms project.

 <ci:CircleImage Source="{Binding displayPicture}" WidthRequest="50" HeightRequest="50" VerticalOptions="CenterAndExpand"  Aspect="AspectFill" BorderColor="#5bb6e7" BorderThickness="2"/>

Previously i was working on Visual studio 2017 V15.9.30. It simply shows the image from URL. Even in iOS, it is working fine. enter image description here(Visual Studio 2017) enter image description here(iOS)

Currently, i have updated to visual studio 2019 v16.8.5. But here image is not getting displayed. Same code is running on both the versions but can't get the image in Visual Studio 2019. enter image description here(Visual studio 2019)

I've tried all possible solutions but it isn't working yet. Can someone help me out with this, please?

Points i have tried :

Image source URL is HTTPS.
HttpClient Implementation is Managed
SSL/TLS Implementation is Native TLS 1.2+
In Manifest file i have added android:usesCleartextTraffic="true"
Tried using ImageSourceConverter. But not able to include the library System.Net.WebCient

dotnet-xamarinformsazure-blob-storage
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

JarvanZhang-MSFT avatar image
1 Vote"
JarvanZhang-MSFT answered JarvanZhang-MSFT edited

Hello,​

Welcome to our Microsoft Q&A platform!

Hi, @PrasanthKumar-9388 Did you update the nuget packages after updating the VS? Visual Studio may reference different apis by default with VS 2017. Try to update the nuget packages to the lastest stable version on both the shared project and each platform project. Then clean and rebuild. For Android, the lastest Xamarin.Forms 5.0 requires the TargetFramework to be Adnroid 10 or above and AndroidX is now the default on Android. If you defined some cusotm code in Android project, please change the related namespaces to AndroidX.*.

Best Regards,

Jarvan Zhang



If the response is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.