32

How to solve this error: Render problem Path.op() not supported

I tried to force refresh layout, restart, update Android Studio, stop antivirus for a while, but the problem is still there.

Surprisingly I am able to compile and run the app, but how to get rid of this error?

I am using:

  • Android Studio 3.5.3
  • Android SDK Tools 29.0.2
  • Android SDK Platform Android 10.0 (Q) Android SDK Platform 29
  • Default OpenJDK Platform binary

to reproduce the error:

  • Create new Android project with empty activity
  • replace the layout with the following layout:

    <?xml version="1.0" encoding="utf-8"?>    <androidx.coordinatorlayout.widget.CoordinatorLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:id="@+id/parent_view"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context=".MainActivity"
        android:background="@android:color/white">
    
    
        <com.google.android.material.appbar.AppBarLayout
            android:id="@+id/appbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
    
            <include layout="@layout/toolbar" />
    
        </com.google.android.material.appbar.AppBarLayout>
    
        <androidx.core.widget.NestedScrollView
            android:id="@+id/nested_scroll_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:clipToPadding="false"
            android:scrollbars="none"
            android:scrollingCache="true"
            app:layout_behavior="@string/appbar_scrolling_view_behavior">
    
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical">
    
                <androidx.cardview.widget.CardView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    app:cardCornerRadius="0dp"
                    app:cardElevation="2dp">
    
                    <RelativeLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content">
    
                        <androidx.viewpager.widget.ViewPager
                            android:id="@+id/pager"
                            android:layout_width="match_parent"
                            android:layout_height="250dp"
                            android:layout_alignParentLeft="true"
                            android:layout_alignParentStart="true"
                            android:layout_alignParentTop="true"
                            android:background="@android:color/darker_gray" />
    
                        <RelativeLayout
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_alignParentBottom="true"
                            android:layout_centerHorizontal="true"
                            android:orientation="vertical"
                            android:paddingBottom="16dp"
                            android:paddingLeft="12dp"
                            android:paddingRight="12dp"
                            android:paddingTop="14dp">
    
                            <LinearLayout
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:orientation="vertical">
    
                                <TextView
                                    android:id="@+id/title"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:text="Title is going here"
                                    android:textAppearance="@style/TextAppearance.AppCompat.Medium"
                                    android:textColor="@android:color/white" />
    
    
    
    
    
                                <TextView
                                    android:id="@+id/brief"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:text=" Location"
                                    android:textAppearance="@style/TextAppearance.AppCompat.Small"  />
    
    
                            </LinearLayout>
    
                            <LinearLayout
                                android:id="@+id/layout_dots"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_alignParentBottom="true"
                                android:layout_alignParentEnd="true"
                                android:layout_alignParentRight="true"
                                android:layout_gravity="end"
                                android:gravity="center"
                                android:orientation="horizontal" />
    
    
                        </RelativeLayout>
    
                    </RelativeLayout>
    
                </androidx.cardview.widget.CardView>
    
                <View
                    android:layout_width="0dp"
                    android:layout_height="16dp" />
    
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_margin="16dp"
                    android:orientation="vertical">
    
                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Description"
                        android:textAppearance="@style/TextAppearance.AppCompat.Large"
                        android:textColor="@android:color/darker_gray" />
    
                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="6dp"
                        android:lineSpacingExtra="4dp"
                        android:text="very_long_lorem_ipsum very_long_lorem_ipsum very_long_lorem_ipsum very_long_lorem_ipsum very_long_lorem_ipsum very_long_lorem_ipsum very_long_lorem_ipsum very_long_lorem_ipsum very_long_lorem_ipsum very_long_lorem_ipsum very_long_lorem_ipsum very_long_lorem_ipsum very_long_lorem_ipsum very_long_lorem_ipsum very_long_lorem_ipsum very_long_lorem_ipsum very_long_lorem_ipsum very_long_lorem_ipsum very_long_lorem_ipsum "
                        android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
                        android:textColor="@android:color/darker_gray"/>
    
    
                </LinearLayout>
    
                <View
                    android:layout_width="0dp"
                    android:layout_height="8dp" />
    
    
            </LinearLayout>
    
        </androidx.core.widget.NestedScrollView>
    

enter image description here

Eng. Samer T
  • 6,465
  • 6
  • 36
  • 43

16 Answers16

41

I was facing the same problem. The reason is, that the new versions of Material Components are bundled with this bug. So, I tried replacing the version in the Gradle build script with the version that supports Path.op().

So, the only thing you have to do is replace the dependency in your Gradle build script with this one:

implementation 'com.google.android.material:material:1.2.0-alpha02'

Matt Ke
  • 3,599
  • 12
  • 30
  • 49
João Gabriel
  • 419
  • 6
  • 7
  • Worked for me as well. Button icons were not showing on layouts, this solved the issue. – FraK Feb 20 '20 at 01:06
  • 1
    The current latest version: `'com.google.android.material:material:1.3.0'` seems to have fixed the bug – Peter Wauyo Feb 09 '21 at 14:25
  • 7
    Solution: use new layout rendering engine. For this go to Settings -> Experimental -> Check "Use new Layout Rendering Engine" – Carlos Feb 10 '21 at 16:19
11

Problem solved by replacing the material component implementation in Gradle Build ( at App level )

com.google.android.material:material:1.2.0-alpha05

to

com.google.android.material:material:1.2.0-alpha02
omarb1989
  • 111
  • 5
5

Use the Experimental Rendering Engine, which solved the problem for me. First Suggested by Carlos.

Here is how to do it in android studio.

Go to File > Settings

Go to File > Settings

Now the settings window will show up.
Go to the Experimental tab and check/tick Use new Layout Rendering Engine

enter image description here

That's it!

Ole Pannier
  • 3,208
  • 9
  • 22
  • 33
4

I bumped into the same problem yesterday. Mine got to do with the

com.google.android.material.appbar.AppBarLayout

component. I do not know exactly why, but adding android:background="..." solves it.

rhesa
  • 41
  • 1
4

A little late but

implementation 'com.google.android.material:material:1.2.0-alpha06'

works correctly, so no need to downgrade to alpha02 anymore.

JakubHyla
  • 49
  • 2
3

Using the new Layout Rendering Engine helped fixing my problem. Go to Settings -> Experimental -> Use new Layout Rendering Engine

Neur0
  • 367
  • 5
  • 13
2

The error seems to have been resolved in the latest version of material components which is currently:

implementation 'com.google.android.material:material:1.3.0'
Peter Wauyo
  • 827
  • 1
  • 8
  • 11
1

I faced the same problem. The problem improved when I run the application. I think the problem will be improved when you clear and rebuild your project.

1

anyone going through this problem just downgrade or upgrade you material design dependency to

 implementation 'com.google.android.material:material:1.2.0-alpha02'

seems to be more stable in terms of rendering especially if you are using android studio V3.4 and above. I miss eclipse sometimes

Andrew Mititi
  • 933
  • 12
  • 11
0

faced same issue while using chip,it's not visible in layout editor. resolved it by changing

implementation 'com.google.android.material:material:1.2.0-alpha03'

to

implementation 'com.google.android.material:material:1.2.0-alpha02'
Vikas Sharma
  • 685
  • 8
  • 18
0

Replace

implementation fileTree(dir: 'libs', include: ['*.jar'])

api 'com.google.android.material:material:1.2.0-alpha06'

to

implementation fileTree(dir: 'libs', include: ['*.jar'])

api 'com.google.android.material:material:1.2.0-alpha02'
Ali Al Fayed
  • 495
  • 1
  • 5
  • 13
0

If you are using "ImageView"s inside your make sure their XML code is like this.

Your default generated could be like below. Wrong XML Code

Change (tools:srcCompat="@drawable/img_avatar") to (android:src="@drawable/img_avatar") like below Correct XML Code

I think it will fix that problem for you. Thank you.

Additional Details:- My Android Studio Version My Gradle Dependencies

I ran into this problem when I tried to display a PNG in a ImgView.

Isira Adithya
  • 307
  • 2
  • 8
0

Just updating: version 1.3.0-rc01 is already launched. You can use

implementation 'com.google.android.material:material:1.3.0-rc01'

Valney Faria
  • 113
  • 2
  • 10
  • Solution: use new layout rendering engine. For this go to Settings -> Experimental -> Check "Use new Layout Rendering Engine" – Carlos Feb 10 '21 at 16:19
0

Just don't define version: implementation 'com.google.android.material:material' It worked for me.

0

For me, only after removing fastScroll settings from androidx.recyclerview.widget.RecyclerView, solved the problem.

Tzigi
  • 1
  • 2
0

changing the dependency worked for me:

implementation 'com.google.android.material:material:1.2.0'

rahul.taicho
  • 1,339
  • 1
  • 8
  • 18