Skip to content

"System.FormatException: Input string was not in a correct format" in a SVG Path Data #2855

Closed

Description

@YGuerin

I'm submitting a...

  • Bug report (I searched for similar issues and did not find one)

Current behavior

Path Data from a SVG file is not supported on Android.

Expected behavior

Path Data from every SVG are supported

Minimal reproduction of the problem with instructions

<DataTemplate x:Key="MapIcon">
	<PathIcon Data="M17.432 11.619c.024.082.04.165.04.247V26.54c0 .37-.271.552-.605.409l-5.339-2.282c-.336-.144-.604-.558-.604-.926V9.066c0-.368.27-.551.604-.409l5.339 2.283a.898.898 0 01.27.188c.09.169.189.333.295.49M9.615 9.07v14.675c0 .368-.27.782-.605.925l-5.339 2.282c-.334.143-.604-.04-.604-.408V11.868c0-.368.269-.782.604-.926l5.34-2.282c.333-.143.604.04.604.41m15.713 4.173V23.74c0 .368-.27.782-.605.926l-5.338 2.282c-.334.143-.604-.04-.604-.41V13.216c1.015 1.231 2.702 3.615 3.136 6.3h.312c.43-2.665 2.087-5.033 3.099-6.272m-3.217-2.39c-2.065 0-3.738-1.705-3.738-3.808 0-2.102 1.673-3.807 3.738-3.807 2.064 0 3.738 1.705 3.738 3.807 0 2.103-1.674 3.808-3.738 3.808M22.054 2c-2.768 0-5.012 2.286-5.012 5.105 0 1.378.531 2.693 1.401 3.611 0 0 2.928 2.912 3.488 6.389h.279c.56-3.477 3.471-6.389 3.471-6.389.873-.918 1.386-2.232 1.386-3.61 0-2.82-2.245-5.106-5.013-5.106"
		  VerticalAlignment="Center" />
</DataTemplate>

Environment

Nuget Package:

Package Version(s):
1.32.0

Affected platform(s):

  • iOS
  • Android
  • WebAssembly
  • Windows
  • Build tasks

Visual Studio

  • 2019 (version: 16.5.0)
  • 2017 (version: )
  • 2017 Preview (version: )
  • for Mac (version: )

Relevant links
https://dev.azure.com/nventive/DevOps/_workitems/edit/177544/

Activity

  1. added
    kind/bug
    on May 26, 2020
  2. modified the milestone: 3.1 on Aug 28, 2020
  3. added
    project/shapes-brushes 🔶
    on Sep 21, 2020
  4. added
    platform/android 🤖
    on Nov 11, 2020
  5. added
    difficulty/tbd
    on Feb 15, 2021
  6. added
    difficulty/starter 🚀
    and removed
    difficulty/tbd
    on Jun 1, 2021
  7. Youssef1313 commented on Sep 12, 2021

    @Youssef1313
    Member

    I'm not able to reproduce. @jeromelaban Was this already fixed?

    Code I used to repro:

            <Button>
                <Button.ContentTemplate>
                    <DataTemplate>
                        <PathIcon Data="M17.432 11.619c.024.082.04.165.04.247V26.54c0 .37-.271.552-.605.409l-5.339-2.282c-.336-.144-.604-.558-.604-.926V9.066c0-.368.27-.551.604-.409l5.339 2.283a.898.898 0 01.27.188c.09.169.189.333.295.49M9.615 9.07v14.675c0 .368-.27.782-.605.925l-5.339 2.282c-.334.143-.604-.04-.604-.408V11.868c0-.368.269-.782.604-.926l5.34-2.282c.333-.143.604.04.604.41m15.713 4.173V23.74c0 .368-.27.782-.605.926l-5.338 2.282c-.334.143-.604-.04-.604-.41V13.216c1.015 1.231 2.702 3.615 3.136 6.3h.312c.43-2.665 2.087-5.033 3.099-6.272m-3.217-2.39c-2.065 0-3.738-1.705-3.738-3.808 0-2.102 1.673-3.807 3.738-3.807 2.064 0 3.738 1.705 3.738 3.807 0 2.103-1.674 3.808-3.738 3.808M22.054 2c-2.768 0-5.012 2.286-5.012 5.105 0 1.378.531 2.693 1.401 3.611 0 0 2.928 2.912 3.488 6.389h.279c.56-3.477 3.471-6.389 3.471-6.389.873-.918 1.386-2.232 1.386-3.61 0-2.82-2.245-5.106-5.013-5.106"
                		    VerticalAlignment="Center" />
    
                    </DataTemplate>
                </Button.ContentTemplate>
            </Button>

    Result:

    image

    Edit: Sorry, was using UWP head 😄

  8. Youssef1313 commented on Sep 12, 2021

    @Youssef1313
    Member

    We use Avalonia parser here. I opened AvaloniaUI/Avalonia#6577.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    difficulty/starter 🚀kind/bugplatform/android 🤖project/shapes-brushes 🔶

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions