Android lottie java.lang.IllegalStateException: Missing values for keyframe.

问题一

  • 在Adobe After Effects和bodymovin插件,重新导出json后,正常显示。Settings > Advanced > Export Old Json Format

问题二

  • java.lang.IllegalStateException: You must set an images folder before loading an image. Set it with LottieComposition#setImagesFolder or LottieDrawable#setImagesFolder
  • 在assets下创建文件夹 splash
    • 将动画需要的图片放入文件夹
 <com.airbnb.lottie.LottieAnimationView
        android:id="@+id/splash_animation"
        android:layout_width="300dp"
        android:layout_height="300dp"
        android:layout_centerInParent="true"
        app:lottie_autoPlay="true"
        app:lottie_imageAssetsFolder="splash"
        app:lottie_fileName="android.json"
        app:lottie_loop="false">
 </com.airbnb.lottie.LottieAnimationView>
发布了175 篇原创文章 · 获赞 56 · 访问量 3万+

猜你喜欢

转载自blog.csdn.net/qq_39424143/article/details/104373308