Android Question android:pathData Error parsing manifest script CreateResource

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

Brandsum

Well-Known Member
Licensed User
I'm trying to create a drawable resource. Here is my code:

B4X:
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?
 

Erel

Administrator
Staff member
Licensed User
Comma is a special character in the manifest editor. You need to escape commas. Like this:
B4X:
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>
)
 
Top