作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
将我的 targetSdkVersion 更新到 28 时出现以下错误,该应用程序在以前的版本中运行良好,但特别是在 android 9 中给了我这个错误。我看过几个 github 链接,他们提到基本书目已更新到 6.0.8,我不明白。有人可以告诉我如何解决它。我附上了我在 Android Studio 控制台中遇到的错误。
java.lang.IllegalArgumentException: Invalid Layer Save Flag - only ALL_SAVE_FLAGS is allowed
at android.graphics.Canvas.checkValidSaveFlags(Canvas.java:378)
at android.graphics.Canvas.saveLayer(Canvas.java:455)
at com.airbnb.lottie.model.layer.BaseLayer.draw(BaseLayer.java:222)
at com.airbnb.lottie.model.layer.CompositionLayer.drawLayer(CompositionLayer.java:100)
at com.airbnb.lottie.model.layer.BaseLayer.draw(BaseLayer.java:188)
at com.airbnb.lottie.LottieDrawable.draw(LottieDrawable.java:300)
at android.widget.ImageView.onDraw(ImageView.java:1360)
at android.view.View.draw(View.java:20207)
at android.view.View.buildDrawingCacheImpl(View.java:19478)
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.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.support.constraint.ConstraintLayout.dispatchDraw(ConstraintLayout.java:2023)
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:6680)
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)
最佳答案
我遇到过同样的问题。这似乎是一个android 9的问题。通过使用解决它:
implementation 'com.airbnb.android:lottie:2.7.0'
关于android - 层保存标志无效 - Android 9 仅允许使用 ALL_SAVE_FLAGS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57012544/
将我的 targetSdkVersion 更新到 28 时出现以下错误,该应用程序在以前的版本中运行良好,但特别是在 android 9 中给了我这个错误。我看过几个 github 链接,他们提到基本
在旧的 android 版本中,方法是::canvas.save(Canvas.ALL_SAVE_FLAG)但在新的 android 9 版本中,方法是::"canvas.save(Canvas.AL
我是一名优秀的程序员,十分优秀!