Lottie动画在更改动画颜色后出现错误。

3

异常: 原因: com.airbnb.lottie.parser.moshi.JsonDataException: 在路径 $.layers[3].shapes[0].it[1].c.k[3] 处预期为一个双精度浮点数,但实际却是 END_ARRAY

问题描述: 正常的动画工作正常,但在https://editor.lottiefiles.com/更改动画颜色后崩溃

Lottie版本: 3.4.1

implementation "com.airbnb.android:lottie:3.4.1"

Android版本:Android 12

我认为这可能与我选择的动画有关,所以我尝试了另一个动画,但在我改变动画颜色后仍然崩溃。 看起来Lottie编辑器(https://editor.lottiefiles.com/)存在漏洞。

1个回答

8

您可以升级Lottie库到以下版本:

implementation "com.airbnb.android:lottie:3.5.0"

我使用你的Lottie文件进行了测试,它能够正常工作。

<com.airbnb.lottie.LottieAnimationView
    android:id="@+id/animation_view"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:lottie_autoPlay="true"
    app:lottie_loop="true"
    app:lottie_rawRes="@raw/test" />

Your lootie


谢谢,这个方法确实有效,但我也通过使用经典编辑器来更改动画颜色找到了解决方案,现在它可以正常工作了。 - Mihir Sharma
1
我根据这里的指示将Lottie从3.4.0更新到3.5.0,更新成功了。 - Arthur Bertemes

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接