J'obtiens l'erreur suivante lors de la mise à jour de targetSdkVersion vers 28, l'application qui fonctionne parfaitement dans les versions précédentes mais spécifiquement dans Android 9 me donne cette erreur. J'ai vu plusieurs liens github où ils mentionnent que la bibliographie de base a été mise à jour vers 6.0.8, ce que je ne comprends pas. Quelqu'un pourrait me dire comment y remédier. Je joins l'erreur que j'ai dans la console 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)
J'ai eu le même problème. Cela semble être un problème Android 9. Résolu en utilisant:
implementation 'com.airbnb.Android:lottie:2.7.0'
J'espère que ça aide.