-2
I’m having this problem after changing the targetSdkVersion
of 25 for 28, I am having to make this change because it is necessary this sdk to publish in the google store.
To exception
generated:
java.lang.IllegalArgumentException: Invalid Layer Save Flag - only ALL_SAVE_FLAGS is allowed
at android.graphics.Canvas.checkValidSaveFlags(Canvas.java:442)
at android.graphics.Canvas.saveLayer(Canvas.java:519)
at com.mikepenz.materialdrawer.view.BezelImageView.onDraw(BezelImageView.java:209)
at android.view.View.draw(View.java:22213)
at android.view.View.updateDisplayListIfDirty(View.java:21089)
at android.view.View.draw(View.java:21944)
at android.view.ViewGroup.drawChild(ViewGroup.java:4419)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4180)
at android.view.View.updateDisplayListIfDirty(View.java:21080)
at android.view.View.draw(View.java:21944)
at android.view.ViewGroup.drawChild(ViewGroup.java:4419)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4180)
at android.view.View.updateDisplayListIfDirty(View.java:21080)
at android.view.View.draw(View.java:21944)
at android.view.ViewGroup.drawChild(ViewGroup.java:4419)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4180)
at android.view.View.updateDisplayListIfDirty(View.java:21080)
at android.view.View.draw(View.java:21944)
at android.view.ViewGroup.drawChild(ViewGroup.java:4419)
at android.widget.ListView.drawChild(ListView.java:3613)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4180)
at android.widget.AbsListView.dispatchDraw(AbsListView.java:2668)
at android.widget.ListView.dispatchDraw(ListView.java:3608)
at android.view.View.draw(View.java:22216)
at android.widget.AbsListView.draw(AbsListView.java:4369)
at android.view.View.updateDisplayListIfDirty(View.java:21089)
at android.view.View.draw(View.java:21944)
at android.view.ViewGroup.drawChild(ViewGroup.java:4419)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4180)
at android.view.View.draw(View.java:22216)
at android.view.View.updateDisplayListIfDirty(View.java:21089)
at android.view.View.draw(View.java:21944)
at android.view.ViewGroup.drawChild(ViewGroup.java:4419)
at android.support.v4.widget.DrawerLayout.drawChild(DrawerLayout.java:1379)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4180)
at android.view.View.updateDisplayListIfDirty(View.java:21080)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4403)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4376)
at android.view.View.updateDisplayListIfDirty(View.java:21049)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4403)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4376)
at android.view.View.updateDisplayListIfDirty(View.java:21049)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4403)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4376)
at android.view.View.updateDisplayListIfDirty(View.java:21049)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4403)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4376)
at android.view.View.updateDisplayListIfDirty(View.java:21049)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4403)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4376)
at android.view.View.updateDisplayListIfDirty(View.java:21049)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:559)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:565)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:642)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:4058)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3785)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3060)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1888)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8122)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:972)
at android.view.Choreographer.doCallbacks(Choreographer.java:796)
2020-04-13 13:16:46.209 31317-31317/br.com.desen.amauditores E/AndroidRuntime: at android.view.Choreographer.doFrame(Choreographer.java:731)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:957)
at android.os.Handler.handleCallback(Handler.java:907)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:216)
at android.app.ActivityThread.main(ActivityThread.java:7464)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:549)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:955)
I noticed that in class BezelImageView.java
there is a call to saveLayer:
cacheCanvas.saveLayer(mBoundsF, mMaskedPaint,
Canvas.HAS_ALPHA_LAYER_SAVE_FLAG | Canvas.FULL_COLOR_LAYER_SAVE_FLAG);
But this class cannot be changed to default ALL_SAVE_FLAGS
Someone’s been through it and could help me?
If your question has been answered, please accept the answer. See more details at How and why to accept an answer?
– Rafael Tavares