所以我有一个带有 Lottie animationView 的启动画面,带有如下 xml 文件
但是 IDE 说
Cannot resolve class com.airbnb.lottie.LottieAnimationView
问题是我可以在调试和 Splash 内容中运行我的应用程序,完美地显示内容 当我想在发布版本中构建时它不能,因为错误:LottieAnimationView 必须扩展 android.view.View [Instantiatable]
我正在关注此处列出的官方文档 official lottie doc 没有任何问题,Splash 显示在调试版本中
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.airbnb.lottie.LottieAnimationView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:lottie_autoPlay="true"
app:lottie_rawRes="@raw/splash_cat"
app:lottie_loop="true"
app:lottie_speed="1.00" />
</androidx.constraintlayout.widget.ConstraintLayout>
edit1:我使用 flutter 并按照此示例 flutter Lottie Splash