我收到“ java.lang.IllegalArgumentException:无效的Region.Op-仅交集和差异”错误。
我的编译SDK版本为API 28,构建工具版本为:28.0.3,最低SDK版本为API 16,目标SDK版本为API 28。
我的代码:
<ToggleButton
android:id="@+id/ku"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="8dp"
android:textOff="Kapalı"
android:textOn="Açık"
app:layout_constraintBottom_toTopOf="@id/ck"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/DD" />
错误代码:
java.lang.IllegalArgumentException: Invalid Region.Op - only INTERSECT and DIFFERENCE are allowed
at android.graphics.Canvas.checkValidClipOp(Canvas.java:779)
at android.graphics.Canvas.clipRect(Canvas.java:826)
at android.view.ViewGroup_Delegate.drawShadow(ViewGroup_Delegate.java:86)
at android.view.ViewGroup_Delegate.drawChild(ViewGroup_Delegate.java:58)
at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
at android.support.constraint.ConstraintLayout.dispatchDraw(ConstraintLayout.java:2023)
at android.view.View.draw_Original(View.java:20075)
at android.view.View_Delegate.draw(View_Delegate.java:68)
at android.view.View.draw(View.java:19849)
at android.view.ViewGroup.drawChild_Original(ViewGroup.java:4333)
at android.view.ViewGroup_Delegate.drawChild(ViewGroup_Delegate.java:63)
at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
at android.view.View.draw_Original(View.java:20075)
at android.view.View_Delegate.draw(View_Delegate.java:68)
at android.view.View.draw(View.java:19849)
at android.view.ViewGroup.drawChild_Original(ViewGroup.java:4333)
at android.view.ViewGroup_Delegate.drawChild(ViewGroup_Delegate.java:63)
at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
at android.view.View.draw_Original(View.java:20075)
at android.view.View_Delegate.draw(View_Delegate.java:68)
at android.view.View.draw(View.java:19849)
at android.view.ViewGroup.drawChild_Original(ViewGroup.java:4333)
at android.view.ViewGroup_Delegate.drawChild(ViewGroup_Delegate.java:63)
at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
at android.view.View.draw_Original(View.java:20210)
at android.view.View_Delegate.draw(View_Delegate.java:56)
at android.view.View.draw(View.java:20177)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.renderAndBuildResult(RenderSessionImpl.java:405)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.renderAndBuildResult(RenderSessionImpl.java:552)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.render(RenderSessionImpl.java:426)
at com.android.layoutlib.bridge.BridgeRenderSession.render(BridgeRenderSession.java:108)
at com.android.ide.common.rendering.api.RenderSession.render(RenderSession.java:154)
at com.android.ide.common.rendering.api.RenderSession.render(RenderSession.java:136)
at com.android.tools.idea.rendering.RenderTask.lambda$renderInner$5(RenderTask.java:671)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
对不起,我的英语。我是土耳其人。
答案 0 :(得分:0)
使用以下配置应该可以重现该问题:
compileSdkVersion=28
buildToolsVersion=28.0.1
答案 1 :(得分:0)
将Android Studio更新到3.3解决了我的问题。