Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invalid region.op - only intersect and difference are allowed android studio #3

Open
jayb611 opened this issue Feb 9, 2019 · 1 comment

Comments

@jayb611
Copy link

jayb611 commented Feb 9, 2019

invalid region.op - only intersect and difference are allowed android studio

Throws error on 28 SDK

APP_VERSION_CODE=1
APP_VERSION_NAME=1.0
ANDROID_VERSION=9
PHONE_MODEL=Android SDK built for x86
CUSTOM_DATA=
STACK_TRACE=java.lang.IllegalArgumentException: Invalid Region.Op - only INTERSECT and DIFFERENCE are allowed
at android.graphics.Canvas.checkValidClipOp(Canvas.java:779)
at android.graphics.Canvas.clipPath(Canvas.java:1007)
at com.skyline.widget.layout.RoundCornerLayout.dispatchDraw(RoundCornerLayout.java:87)
at android.view.View.buildDrawingCacheImpl(View.java:19472)
at android.view.View.buildDrawingCache(View.java:19338)
at android.view.View.draw(View.java:19927)
at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
at android.view.View.updateDisplayListIfDirty(View.java:19073)
at android.view.View.draw(View.java:19935)
at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
at android.view.View.updateDisplayListIfDirty(View.java:19073)
at android.view.View.draw(View.java:19935)
at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
at android.view.View.draw(View.java:20210)
at android.support.v4.view.ViewPager.draw(ViewPager.java:2426)
at android.view.View.updateDisplayListIfDirty(View.java:19082)
at android.view.View.draw(View.java:19935)
at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
at android.view.View.updateDisplayListIfDirty(View.java:19073)
at android.view.View.draw(View.java:19935)
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.updateDisplayListIfDirty(View.java:19073)
at android.view.View.draw(View.java:19935)
at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
at android.support.design.widget.CoordinatorLayout.drawChild(CoordinatorLayout.java:1246)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
at android.view.View.updateDisplayListIfDirty(View.java:19073)
at android.view.View.draw(View.java:19935)
at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
at android.support.v4.widget.DrawerLayout.drawChild(DrawerLayout.java:1426)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
at android.view.View.draw(View.java:20210)
at android.view.View.updateDisplayListIfDirty(View.java:19082)
at android.view.View.draw(View.java:19935)
at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
at android.view.View.updateDisplayListIfDirty(View.java:19073)
at android.view.View.draw(View.java:19935)
at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
at android.view.View.updateDisplayListIfDirty(View.java:19073)
at android.view.View.draw(View.java:19935)
at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
at android.view.View.updateDisplayListIfDirty(View.java:19073)
at android.view.View.draw(View.java:19935)
at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
at android.view.View.updateDisplayListIfDirty(View.java:19073)
at android.view.View.draw(View.java:19935)
at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
at android.view.View.draw(View.java:20210)
at com.android.internal.policy.DecorView.draw(DecorView.java:780)
at android.view.View.updateDisplayListIfDirty(View.java:19082)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:686)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:692)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:801)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:3311)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3115)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2484)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1460)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7183)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:949)
at android.view.Choreographer.doCallbacks(Choreographer.java:761)
at android.view.Choreographer.doFrame(Choreographer.java:696)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:935)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

LOGCAT=02-09 13:57:51.316 E/AndroidRuntime(15600): at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:692)
02-09 13:57:51.316 E/AndroidRuntime(15600): at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:801)
02-09 13:57:51.317 E/AndroidRuntime(15600): at android.view.ViewRootImpl.draw(ViewRootImpl.java:3311)
02-09 13:57:51.317 E/AndroidRuntime(15600): at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3115)
02-09 13:57:51.317 E/AndroidRuntime(15600): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2484)
02-09 13:57:51.317 E/AndroidRuntime(15600): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1460)
02-09 13:57:51.317 E/AndroidRuntime(15600): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7183)
02-09 13:57:51.317 E/AndroidRuntime(15600): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:949)
02-09 13:57:51.317 E/AndroidRuntime(15600): at android.view.Choreographer.doCallbacks(Choreographer.java:761)
02-09 13:57:51.317 E/AndroidRuntime(15600): at android.view.Choreographer.doFrame(Choreographer.java:696)
02-09 13:57:51.317 E/AndroidRuntime(15600): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:935)
02-09 13:57:51.317 E/AndroidRuntime(15600): at android.os.Handler.handleCallback(Handler.java:873)
02-09 13:57:51.317 E/AndroidRuntime(15600): at android.os.Handler.dispatchMessage(Handler.java:99)
02-09 13:57:51.317 E/AndroidRuntime(15600): at android.os.Looper.loop(Looper.java:193)
02-09 13:57:51.317 E/AndroidRuntime(15600): at android.app.ActivityThread.main(ActivityThread.java:6669)
02-09 13:57:51.317 E/AndroidRuntime(15600): at java.lang.reflect.Method.invoke(Native Method)
02-09 13:57:51.317 E/AndroidRuntime(15600): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
02-09 13:57:51.317 E/AndroidRuntime(15600): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
02-09 13:57:51.321 E/ACRA (15600): ACRA caught a IllegalArgumentException for com.lionvision.LEADcrm
02-09 13:57:51.321 E/ACRA (15600): java.lang.IllegalArgumentException: Invalid Region.Op - only INTERSECT and DIFFERENCE are allowed
02-09 13:57:51.321 E/ACRA (15600): at android.graphics.Canvas.checkValidClipOp(Canvas.java:779)
02-09 13:57:51.321 E/ACRA (15600): at android.graphics.Canvas.clipPath(Canvas.java:1007)
02-09 13:57:51.321 E/ACRA (15600): at com.skyline.widget.layout.RoundCornerLayout.dispatchDraw(RoundCornerLayout.java:87)
02-09 13:57:51.321 E/ACRA (15600): at android.view.View.buildDrawingCacheImpl(View.java:19472)
02-09 13:57:51.321 E/ACRA (15600): at android.view.View.buildDrawingCache(View.java:19338)
02-09 13:57:51.321 E/ACRA (15600): at android.view.View.draw(View.java:19927)
02-09 13:57:51.321 E/ACRA (15600): at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
02-09 13:57:51.321 E/ACRA (15600): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
02-09 13:57:51.321 E/ACRA (15600): at android.view.View.updateDisplayListIfDirty(View.java:19073)
02-09 13:57:51.321 E/ACRA (15600): at android.view.View.draw(View.java:19935)
02-09 13:57:51.321 E/ACRA (15600): at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
02-09 13:57:51.321 E/ACRA (15600): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
02-09 13:57:51.321 E/ACRA (15600): at android.view.View.updateDisplayListIfDirty(View.java:19073)
02-09 13:57:51.321 E/ACRA (15600): at android.view.View.draw(View.java:19935)
02-09 13:57:51.321 E/ACRA (15600): at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
02-09 13:57:51.321 E/ACRA (15600): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
02-09 13:57:51.321 E/ACRA (15600): at android.view.View.draw(View.java:20210)
02-09 13:57:51.321 E/ACRA (15600): at android.support.v4.view.ViewPager.draw(ViewPager.java:2426)
02-09 13:57:51.321 E/ACRA (15600): at android.view.View.updateDisplayListIfDirty(View.java:19082)
02-09 13:57:51.321 E/ACRA (15600): at android.view.View.draw(View.java:19935)
02-09 13:57:51.321 E/ACRA (15600): at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
02-09 13:57:51.321 E/ACRA (15600): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
02-09 13:57:51.321 E/ACRA (15600): at android.view.View.updateDisplayListIfDirty(View.java:19073)
02-09 13:57:51.321 E/ACRA (15600): at android.view.View.draw(View.java:19935)
02-09 13:57:51.321 E/ACRA (15600): at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
02-09 13:57:51.321 E/ACRA (15600): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
02-09 13:57:51.321 E/ACRA (15600): at android.support.constraint.ConstraintLayout.dispatchDraw(ConstraintLayout.java:2023)
02-09 13:57:51.321 E/ACRA (15600): at android.view.View.updateDisplayListIfDirty(View.java:19073)
02-09 13:57:51.321 E/ACRA (15600): at android.view.View.draw(View.java:19935)
02-09 13:57:51.321 E/ACRA (15600): at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
02-09 13:57:51.321 E/ACRA (15600): at android.support.design.widget.CoordinatorLayout.drawChild(CoordinatorLayout.java:1246)
02-09 13:57:51.321 E/ACRA (15600): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
02-09 13:57:51.321 E/ACRA (15600): at android.view.View.updateDisplayListIfDirty(View.java:19073)
02-09 13:57:51.321 E/ACRA (15600): at android.view.View.draw(View.java:19935)
02-09 13:57:51.321 E/ACRA (15600): at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
02-09 13:57:51.321 E/ACRA (15600): at android.support.v4.widget.DrawerLayout.drawChild(DrawerLayout.java:1426)
02-09 13:57:51.321 E/ACRA (15600): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
02-09 13:57:51.321 E/ACRA (15600): at android.view.View.draw(View.java:20210)
02-09 13:57:51.321 E/ACRA (15600): at android.view.View.updateDisplayListIfDirty(View.java:19082)
02-09 13:57:51.321 E/ACRA (15600): at android.view.View.draw(View.java:19935)
02-09 13:57:51.321 E/ACRA (15600): at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
02-09 13:57:51.321 E/ACRA (15600): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
02-09 13:57:51.321 E/ACRA (15600): at android.view.View.updateDisplayListIfDirty(View.java:19073)
02-09 13:57:51.321 E/ACRA (15600): at android.view.View.draw(View.java:19935)
02-09 13:57:51.321 E/ACRA (15600): at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
02-09 13:57:51.321 E/ACRA (15600): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
02-09 13:57:51.321 E/ACRA (15600): at android.view.View.updateDisplayListIfDirty(View.java:19073)
02-09 13:57:51.321 E/ACRA (15600): at android.view.View.draw(View.java:19935)
02-09 13:57:51.321 E/ACRA (15600): at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
02-09 13:57:51.321 E/ACRA (15600): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
02-09 13:57:51.321 E/ACRA (15600): at android.view.View.updateDisplayListIfDirty(View.java:19073)
02-09 13:57:51.321 E/ACRA (15600): at android.view.View.draw(View.java:19935)
02-09 13:57:51.321 E/ACRA (15600): at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
02-09 13:57:51.321 E/ACRA (15600): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
02-09 13:57:51.321 E/ACRA (15600): at android.view.View.updateDisplayListIfDirty(View.java:19073)
02-09 13:57:51.321 E/ACRA (15600): at android.view.View.draw(View.java:19935)
02-09 13:57:51.321 E/ACRA (15600): at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
02-09 13:57:51.321 E/ACRA (15600): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
02-09 13:57:51.321 E/ACRA (15600): at android.view.View.draw(View.java:20210)
02-09 13:57:51.321 E/ACRA (15600): at com.android.internal.policy.DecorView.draw(DecorView.java:780)
02-09 13:57:51.321 E/ACRA (15600): at android.view.View.updateDisplayListIfDirty(View.java:19082)
02-09 13:57:51.321 E/ACRA (15600): at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:686)
02-09 13:57:51.321 E/ACRA (15600): at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:692)
02-09 13:57:51.321 E/ACRA (15600): at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:801)
02-09 13:57:51.321 E/ACRA (15600): at android.view.ViewRootImpl.draw(ViewRootImpl.java:3311)
02-09 13:57:51.323 E/ACRA (15600): at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3115)
02-09 13:57:51.323 E/ACRA (15600): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2484)
02-09 13:57:51.323 E/ACRA (15600): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1460)
02-09 13:57:51.323 E/ACRA (15600): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7183)
02-09 13:57:51.323 E/ACRA (15600): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:949)
02-09 13:57:51.323 E/ACRA (15600): at android.view.Choreographer.doCallbacks(Choreographer.java:761)
02-09 13:57:51.323 E/ACRA (15600): at android.view.Choreographer.doFrame(Choreographer.java:696)
02-09 13:57:51.323 E/ACRA (15600): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:935)
02-09 13:57:51.323 E/ACRA (15600): at android.os.Handler.handleCallback(Handler.java:873)
02-09 13:57:51.323 E/ACRA (15600): at android.os.Handler.dispatchMessage(Handler.java:99)
02-09 13:57:51.323 E/ACRA (15600): at android.os.Looper.loop(Looper.java:193)
02-09 13:57:51.323 E/ACRA (15600): at android.app.ActivityThread.main(ActivityThread.java:6669)
02-09 13:57:51.323 E/ACRA (15600): at java.lang.reflect.Method.invoke(Native Method)
02-09 13:57:51.323 E/ACRA (15600): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
02-09 13:57:51.323 E/ACRA (15600): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

@mohammadyacn314
Copy link

mohammadyacn314 commented Nov 9, 2020

Hi @jayb611
copy all code of RoundCornerLayout class to your class for example name MyRoundCornerLayout .
then in function dispatchDraw(Canvas canvas) replace

canvas.clipPath(path, Region.Op.REPLACE);
canvas.clipPath(path);

with

if (Build.VERSION.SDK_INT >= 26) {
     canvas.clipPath(path);
} else {
     canvas.clipPath(path, Region.Op.REPLACE);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants