airbnb / lottie-android

Render After Effects animations natively on Android and iOS, Web, and React Native
http://airbnb.io/lottie/
Apache License 2.0
35.03k stars 5.41k forks source link

App crash: ShapeData.getCurves() null object reference #2430

Closed youlovejohnny closed 10 months ago

youlovejohnny commented 10 months ago

Bug description

App just crashes on screen start which contains lottie animation. No addition actions required, i tried it on empty project and it still crashes

What version of Lottie did you test this on? Tried on:

What version of Android did you test this on?

Steps To Reproduce

  1. Import lottie animation json
  2. Run app
  3. Crash

Stacktrace: java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.List com.airbnb.lottie.model.content.ShapeData.getCurves()' on a null object at com.airbnb.lottie.model.content.ShapeData.interpolateBetween(ShapeData.java:60) at com.airbnb.lottie.animation.keyframe.ShapeKeyframeAnimation.getValue(ShapeKeyframeAnimation.java:28) at com.airbnb.lottie.animation.keyframe.ShapeKeyframeAnimation.getValue(ShapeKeyframeAnimation.java:14) at com.airbnb.lottie.animation.keyframe.BaseKeyframeAnimation.getValue(BaseKeyframeAnimation.java:150) at com.airbnb.lottie.animation.content.ShapeContent.getPath(ShapeContent.java:79) at com.airbnb.lottie.animation.content.FillContent.draw(FillContent.java:129) at com.airbnb.lottie.animation.content.ContentGroup.draw(ContentGroup.java:190) at com.airbnb.lottie.animation.content.ContentGroup.draw(ContentGroup.java:190) at com.airbnb.lottie.model.layer.ShapeLayer.drawLayer(ShapeLayer.java:37) at com.airbnb.lottie.model.layer.BaseLayer.draw(BaseLayer.java:260) at com.airbnb.lottie.model.layer.CompositionLayer.drawLayer(CompositionLayer.java:130) at com.airbnb.lottie.model.layer.BaseLayer.draw(BaseLayer.java:260) at com.airbnb.lottie.model.layer.CompositionLayer.drawLayer(CompositionLayer.java:130) at com.airbnb.lottie.model.layer.BaseLayer.draw(BaseLayer.java:260) at com.airbnb.lottie.model.layer.CompositionLayer.drawLayer(CompositionLayer.java:130) at com.airbnb.lottie.model.layer.BaseLayer.draw(BaseLayer.java:260) at com.airbnb.lottie.model.layer.CompositionLayer.drawLayer(CompositionLayer.java:130) at com.airbnb.lottie.model.layer.BaseLayer.draw(BaseLayer.java:260) at com.airbnb.lottie.LottieDrawable.drawDirectlyToCanvas(LottieDrawable.java:1610) at com.airbnb.lottie.LottieDrawable.draw(LottieDrawable.java:675) at android.widget.ImageView.onDraw(ImageView.java:1446) at android.view.View.draw(View.java:23889) at android.view.View.updateDisplayListIfDirty(View.java:22756) at android.view.View.draw(View.java:23620) at android.view.ViewGroup.drawChild(ViewGroup.java:4556) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4317) at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw(ConstraintLayout.java:1882) at android.view.View.updateDisplayListIfDirty(View.java:22747) at android.view.View.draw(View.java:23620) at android.view.ViewGroup.drawChild(ViewGroup.java:4556) at androidx.recyclerview.widget.RecyclerView.drawChild(RecyclerView.java:5499) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4317) at android.view.View.draw(View.java:23892) at androidx.recyclerview.widget.RecyclerView.draw(RecyclerView.java:4898) at android.view.View.updateDisplayListIfDirty(View.java:22756) at android.view.View.draw(View.java:23620) at android.view.ViewGroup.drawChild(ViewGroup.java:4556) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4317) at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw(ConstraintLayout.java:1882) at android.view.View.draw(View.java:23892) at android.view.View.updateDisplayListIfDirty(View.java:22756) at android.view.View.draw(View.java:23620) at android.view.ViewGroup.drawChild(ViewGroup.java:4556) at androidx.fragment.app.FragmentContainerView.drawChild(FragmentContainerView.kt:235) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4317) at androidx.fragment.app.FragmentContainerView.dispatchDraw(FragmentContainerView.kt:225) at android.view.View.updateDisplayListIfDirty(View.java:22747) at android.view.View.draw(View.java:23620) at android.view.ViewGroup.drawChild(ViewGroup.java:4556) at androidx.fragment.app.FragmentContainerView.drawChild(FragmentContainerView.kt:235) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4317) at androidx.fragment.app.FragmentContainerView.dispatchDraw(FragmentContainerView.kt:225) at android.view.View.updateDisplayListIfDirty(View.java:22747) at android.view.View.draw(View.java:23620) at android.view.ViewGroup.drawChild(ViewGroup.java:4556) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4317) at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw(ConstraintLayout.java:1882) at android.view.View.draw(View.java:23892) at android.view.View.updateDisplayListIfDirty(View.java:22756) at android.view.View.draw(View.java:23620) at android.view.ViewGroup.drawChild(ViewGroup.java:4556) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4317) at android.view.View.updateDisplayListIfDirty(View.java:22747) at android.view.View.draw(View.java:23620) at android.view.ViewGroup.drawChild(ViewGroup.java:4556) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4317) at android.view.View.updateDisplayListIfDirty(View.java:22747) at android.view.View.draw(View.java:23620) at android.view.ViewGroup.drawChild(ViewGroup.java:4556) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4317) at android.view.View.updateDisplayListIfDirty(View.java:22747) at android.view.View.draw(View.java:23620) at android.view.ViewGroup.drawChild(ViewGroup.java:4556) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4317) at android.view.View.updateDisplayListIfDirty(View.java:22747) at android.view.View.draw(View.java:23620) at android.view.ViewGroup.drawChild(ViewGroup.java:4556) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4317) at android.view.View.draw(View.java:23892) at com.android.internal.policy.DecorView.draw(DecorView.java:809) at android.view.View.updateDisplayListIfDirty(View.java:22756) at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:694) at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:700) at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:798) at android.view.ViewRootImpl.draw(ViewRootImpl.java:4939) at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:4643) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3822) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2465) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:9305) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1339) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1348) at android.view.Choreographer.doCallbacks(Choreographer.java:952) at android.view.Choreographer.doFrame(Choreographer.java:882) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1322) at android.os.Handler.handleCallback(Handler.java:958) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:205) at android.os.Looper.loop(Looper.java:294) at android.app.ActivityThread.main(ActivityThread.java:8177) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971) Screenshots

image image

Json animation file: ai_look_down_start.json

lanserxt commented 10 months ago

+1

fzrcyc commented 10 months ago

the same problem