如何解决不支持的渲染问题Path.op()? [英] how to solve render problem Path.op() not supported?

查看:167
本文介绍了如何解决不支持的渲染问题Path.op()?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何解决此错误: 渲染问题 不支持Path.op()

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

我试图强制刷新布局,重新启动,更新Android Studio,暂时停止防病毒,但是问题仍然存在.

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?

我正在使用:

  • Android Studio 3.5.3
  • Android SDK工具29.0.2
  • Android SDK平台Android 10.0(Q)Android SDK平台29
  • 默认的OpenJDK平台二进制文件

重现该错误:

  • 创建具有空活动的新Android项目
  • 使用以下布局替换该布局:

  • 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>

推荐答案

我遇到了同样的问题.原因是,新版本的Material Components与此错误捆绑在一起.因此,我尝试用支持Path.op()的版本替换Gradle构建脚本中的版本.

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().

因此,您唯一要做的就是用以下代码替换Gradle构建脚本中的依赖项:

实现'com.google.android.material:material:1.2.0-alpha02'

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

这篇关于如何解决不支持的渲染问题Path.op()?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆