Lottie-android: Missing values for keyframe

Created on 10 Apr 2019  路  27Comments  路  Source: airbnb/lottie-android

I'm exporting my animation using BodyMovin and I'm getting this error

 java.lang.IllegalStateException: Missing values for keyframe.
        at com.airbnb.lottie.animation.keyframe.FloatKeyframeAnimation.getValue(FloatKeyframeAnimation.java:16)
        at com.airbnb.lottie.animation.keyframe.FloatKeyframeAnimation.getValue(FloatKeyframeAnimation.java:8)
        at com.airbnb.lottie.animation.keyframe.BaseKeyframeAnimation.getValue(BaseKeyframeAnimation.java:125)
        at com.airbnb.lottie.animation.keyframe.TransformKeyframeAnimation.getMatrix(TransformKeyframeAnimation.java:113)

I also have problems when I try to click on "edit layer colors" it doesn't show the animation, what I'm missing?

Most helpful comment

@joancolmenerodev @hlk-trkn @meylinb @aadishgoel2013 that is correct. Lottie 3.0 and Bodymovin 5.5 has some significant json optimizations that will save upwards of 1/3 on the json size and parse speed. However, you must be on 3.0 or enable "export as old format" in bodymovin settings.

All 27 comments

My json files works fine when i see it on preview in https://lottiefiles.com/preview but in android This Error keeps on coming
Process: com.example.lottietry, PID: 16998 java.lang.IllegalStateException: Missing values for keyframe. at com.airbnb.lottie.animation.keyframe.FloatKeyframeAnimation.getValue(FloatKeyframeAnimation.java:16) at com.airbnb.lottie.animation.keyframe.FloatKeyframeAnimation.getValue(FloatKeyframeAnimation.java:8) at com.airbnb.lottie.animation.keyframe.BaseKeyframeAnimation.getValue(BaseKeyframeAnimation.java:125) at com.airbnb.lottie.animation.keyframe.TransformKeyframeAnimation.getMatrix(TransformKeyframeAnimation.java:113) at com.airbnb.lottie.model.layer.BaseLayer.draw(BaseLayer.java:199) at com.airbnb.lottie.model.layer.CompositionLayer.drawLayer(CompositionLayer.java:100) at com.airbnb.lottie.model.layer.BaseLayer.draw(BaseLayer.java:201) at com.airbnb.lottie.LottieDrawable.draw(LottieDrawable.java:319) at android.widget.ImageView.onDraw(ImageView.java:1367) at android.view.View.draw(View.java:19226) at android.view.View.buildDrawingCacheImpl(View.java:18474) at android.view.View.buildDrawingCache(View.java:18334) at android.view.View.draw(View.java:18946) at android.view.ViewGroup.drawChild(ViewGroup.java:4240) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024) at android.view.View.updateDisplayListIfDirty(View.java:18167) at android.view.View.draw(View.java:18954) at android.view.ViewGroup.drawChild(ViewGroup.java:4240) at android.support.design.widget.CoordinatorLayout.drawChild(CoordinatorLayout.java:1246) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024) at android.view.View.updateDisplayListIfDirty(View.java:18167) at android.view.View.draw(View.java:18954) at android.view.ViewGroup.drawChild(ViewGroup.java:4240) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024) at android.view.View.updateDisplayListIfDirty(View.java:18167) at android.view.View.draw(View.java:18954) at android.view.ViewGroup.drawChild(ViewGroup.java:4240) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024) at android.view.View.updateDisplayListIfDirty(View.java:18167) at android.view.View.draw(View.java:18954) at android.view.ViewGroup.drawChild(ViewGroup.java:4240) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024) at android.view.View.updateDisplayListIfDirty(View.java:18167) at android.view.View.draw(View.java:18954) at android.view.ViewGroup.drawChild(ViewGroup.java:4240) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024) at android.view.View.updateDisplayListIfDirty(View.java:18167) at android.view.View.draw(View.java:18954) at android.view.ViewGroup.drawChild(ViewGroup.java:4240) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024) at android.view.View.draw(View.java:19229) at com.android.internal.policy.DecorView.draw(DecorView.java:791) at android.view.View.updateDisplayListIfDirty(View.java:18176) at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:685) at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:691) at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:799) at android.view.ViewRootImpl.draw(ViewRootImpl.java:3056) at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2851) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2404) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1437) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6886) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1029) at android.view.Choreographer.doCallbacks(Choreographer.java:841) at android.view.Choreographer.doFrame(Choreographer.java:772) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1015) at android.os.Handler.handleCallback(Handler.java:794) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:176) at android.app.ActivityThread.main(ActivityThread.java:6651) at java.lang.reflect.Method.invoke(Native Method) 2019-04-10 11:13:35.094 16998-16998/com.example.lottietry E/AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:824)

Same issue here, trying to figure out what is going on. Do you think it might be something with the update? (We still havent updated on Android to the latest lottie version since it requires Android X)

Hi @joancolmenerodev. I have also same issue today but then I founded this post and solve the problem.Now my animations working on android project.
https://github.com/airbnb/lottie-web/issues/1561
In sum,
bodymovin plugin has updated 5.5 recently so some animations have keyframe value issues. While exporting json from Ae you should have to change advanced export settings to old versions. Or you could update your player package. I choose first way and now everything is ok.

@joancolmenerodev @hlk-trkn @meylinb @aadishgoel2013 that is correct. Lottie 3.0 and Bodymovin 5.5 has some significant json optimizations that will save upwards of 1/3 on the json size and parse speed. However, you must be on 3.0 or enable "export as old format" in bodymovin settings.

can someone convert this json to old format and post here ? https://lottiefiles.com/5737-lock-and-unlock

@vinnusaurus I recommend that you upgrade Lottie instead. There is no tool to do the backwards conversion.

@vinnusaurus I recommend that you upgrade Lottie instead. There is no tool to do the backwards conversion.
i am using xamarin, no luck

@joancolmenerodev @hlk-trkn @meylinb @aadishgoel2013 that is correct. Lottie 3.0 and Bodymovin 5.5 has some significant json optimizations that will save upwards of 1/3 on the json size and parse speed. However, you must be on 3.0 or enable "export as old format" in bodymovin settings.

"export as old format" solved my problem due to androidx reason cannot upgrade to 3.0

just update? someone had examples? :(

I tried to upgrade Lotte library to 3.0.0 , but I think that i should migrate to AndroidX.
Is there another solution without upgrading Lottie library ?

@amine03061990 you should upgrade to androidx for a host of other reasons but there is a one time 3.0.3-support release.

thanks thanks a lot for the 3.0.3-support. it saves my life

thanks thanks a lot for the 3.0.3-support. it saves my life
@gpeal @androidfans Hi, do you know where I can find the 3.0.3-support.? I can't see it on the list.

@Lohins it's on maven.

How can I fix this issue from Expo?

I can confirm I fixed this issue by updating Lottie to 3.0.7. Was experiencing the issue with an older version (2.8.0). Just changing the dependency did work for me

@gpeal Lottie 2.8.0 and above only supports projects that have been migrated to androidx. For more information, read Google's migration guide. so, are you kidding me ? goodbye..

@985211yygg There was a one-time 3.0.3-support published.

migrate to '3.0.3-support' version fix my issue too . thanks

Hi @MehrAmoon, how to install 3.0.3-support?

imagen

@LcsGrz That is lottie-react-native. You'll have to file an issue there.

@gpeal You're right. My mistake :(

3.0.3-support. it saves my life
HAPPY 2020

Please update your library to solve this problem.
This worked for me.

Thanks

@amine03061990 you should upgrade to androidx for a host of other reasons but there is a one time 3.0.3-support release.

Hi, Can you tell me how to create 3.4.0-support release, since i need to support some fixes in latest lottie without migrating to AndroidX

3.4.0-support saved my year in my life

Hi @joancolmenerodev. I have also same issue today but then I founded this post and solve the problem.Now my animations working on android project.
airbnb/lottie-web#1561
In sum,
bodymovin plugin has updated 5.5 recently so some animations have keyframe value issues. While exporting json from Ae you should have to change advanced export settings to old versions. Or you could update your player package. I choose first way and now everything is ok.

Thank you it i am update package and solve it thank you very good

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mmakmw picture mmakmw  路  4Comments

nick1Jian picture nick1Jian  路  3Comments

Qamar4P picture Qamar4P  路  3Comments

AndroidDeveloperLB picture AndroidDeveloperLB  路  4Comments

Nabeel-khalid picture Nabeel-khalid  路  4Comments