Android Question android:pathData Error parsing manifest script CreateResource

Discussion in 'Android Questions' started by Brandsum, Nov 27, 2018.

Tags:

Similar threads

B4A Code Snippet Theme Colors
B4A Code Snippet Full Screen Theme
Other B4A v5.80 BETA is released!
B4A Code Snippet Version safe themes
B4A Tutorial TabStripViewPager - Better ViewPager
B4A Library [class] FileProvider - share files
  1. Brandsum

    Brandsum Member Licensed User

    I'm trying to create a drawable resource. Here is my code:

    Code:
    CreateResource(drawable, custom_back_material.xml,
    <vector xmlns:android=
    "http://schemas.android.com/apk/res/android"
            android:width=
    "24dp"
            android:height=
    "24dp"
            android:viewportWidth=
    "24.0"
            android:viewportHeight=
    "24.0"
            android:autoMirrored=
    "true"
            android:tint=
    "?attr/colorControlNormal">
        <
    path
                android:pathData=
    "M20,11L7.8,11l5.6,-5.6L12,4l-8,8l8,8l1.4,-1.4L7.8,13L20,13L20,11z"
                android:fillColor=
    "@color/colorControlNormal"/>
    </vector>
    )
    When compiling the app I'm getting an error: Error parsing manifest script

    But when I remove commas from pathData it shows no error.
    So commas are causing error.

    Is there any workaround to add commas inside CreateResource?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Comma is a special character in the manifest editor. You need to escape commas. Like this:
    Code:
    CreateResource(drawable, custom_back_material.xml,
    <vector xmlns:android=
    "http://schemas.android.com/apk/res/android"
            android:width=
    "24dp"
            android:height=
    "24dp"
            android:viewportWidth=
    "24.0"
            android:viewportHeight=
    "24.0"
            android:autoMirrored=
    "true"
            android:tint=
    "?attr/colorControlNormal">
        <
    path
                android:pathData=
    "M20,,11L7.8,,11l5.6,,-5.6L12,,4l-8,,8l8,,8l1.4,,-1.4L7.8,,13L20,,13L20,,11z"
                android:fillColor=
    "@color/colorControlNormal"/>
    </vector>
    )
     
  3. Brandsum

    Brandsum Member Licensed User

    Finally got the desired output!! :)

    Thank you so much.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice