question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Xamarin.Forms] SVG image rendering problem on Android

See original GitHub issue

I’m using the latest prerelease available Xamarin.FFImageLoading.Svg.Forms 2.2.10-pre-390 together with Xamarin.Forms 2.3.4.231.

Here is the XAML code used:

<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:ffimageloadingsvg="clr-namespace:FFImageLoading.Svg.Forms;assembly=FFImageLoading.Svg.Forms"
    x:Class="App.Views.MainPage">
    <ContentPage.Content>
        <ffimageloadingsvg:SvgCachedImage
                        HorizontalOptions="Center"
                        VerticalOptions="Center"
                        WidthRequest="200"
                        HeightRequest="200"
                        Source="http://thenewcode.com/assets/images/thumbnails/homer-simpson.svg"/>
    </ContentPage.Content>
</ContentPage>

Is there any known problem when rendering an SVG on Android?

Follow print for comparison of the same screen on both platforms (iOS and Android) screens

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
michelmoorlagcommented, May 23, 2017

I tried with 2.2.10-pre-391 with skiasharp 1.58.0 but the issue is not resolved (yet). Svg colors was messed up for android in SkiaSharp 1.57.1. I added a new issue there: https://github.com/mono/SkiaSharp/issues/300

1reaction
michelmoorlagcommented, May 16, 2017

I have the same issue and found that it is related to SkiaSharp 1.57.1! When you downgrade to Xamarin.FFImageLoading.Svg.Forms 2.2.10-pre-375 and then downgrade SkiaSharp to 1.56.1 it will work fine. BTW this is only on some devices like an Asus zenphone 2 and on my android simulator. On other devices the new version somehow works fine. Maybe it is related to android version, I don’t know.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android 11 SVG rendering blank · Issue #1526
We saw the blank SVG issue on a Samsung Galaxy S10 running Android 11. Our app uses the Xamarin.FFImageLoading.Svg.Forms Nuget, which ultimately uses...
Read more >
Why does Xamarin.FFImageLoading SVG is not working ...
1 Answer. It seems that it's a special issue on the Android 11, and the solution is add the reference of the skiasharp...
Read more >
Xamarin forms: Android 11 : Embedded resource images ...
Issue with embedded resource image is resolved for me now. I am using svg image in my Xamarin application. I had been using...
Read more >
Displaying SVGs in Xamarin.Forms - Damir's Corner
It can create an ImageSource from an SVG so that it can be rendered by Image view just like other image formats. I...
Read more >
SVG image is not displaying in android in xamarin.forms
I am trying ti display the SVG image in my xamarin.form application, there are no issues to display the SVG image in iOS...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found