BottomSheetFragment 上的 Lottie 动画崩溃
我有一个具有以下视图的 BottomSheetDialogFragment:
<com.airbnb.lottie.LottieAnimationView
android:id="@+id/myAnimation"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:contentDescription="@null"
app:layout_constraintBottom_toTopOf="@id/title"
app:layout_constraintStart_toStartOf="@id/image"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="@id/image"
app:lottie_autoPlay="true"
app:lottie_loop="true"
app:lottie_rawRes="@raw/lottie_animation"
tools:src="@raw/lottie_animation" />
当我打开 BottomSheet 并旋转它几次时,经过几次旋转,它会因以下错误而崩溃:
Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 16124 (PixelCopy)
如果我在片段上运行,它不会崩溃。 如果我在不同的(干净的)示例应用程序上进行测试,它不会以任何方式崩溃。
使用不同(可能更轻)的乐蒂动画的其他底部工作表不会崩溃。
我想知道如何找到导致崩溃的原因。
谢谢。
I've a BottomSheetDialogFragment with the following view:
<com.airbnb.lottie.LottieAnimationView
android:id="@+id/myAnimation"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:contentDescription="@null"
app:layout_constraintBottom_toTopOf="@id/title"
app:layout_constraintStart_toStartOf="@id/image"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="@id/image"
app:lottie_autoPlay="true"
app:lottie_loop="true"
app:lottie_rawRes="@raw/lottie_animation"
tools:src="@raw/lottie_animation" />
When I open my bottomSheet and rotate it few times, after few rotations, it crashes with this error:
Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 16124 (PixelCopy)
It doesn't crash if I run in on a Fragment.
It doesn't crash in any way if i test in on a different (clean) sample app.
Other bottom sheets that use different (maybe lighter) lottie animations don't crash.
I wonder how can I find what makes it to crash.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
欢迎来到 SIGSEGV 错误,我的朋友
Welcome to SIGSEGV error, my friend????.
So SIGSEGV error is caused when a program tries to access a memory location outside the allocated memory.
Recently I have also started adding Lottie animations on my Android app and it crashes in slightly lower end devices after a few seconds with this error: Could not allocate X bytes.[In place of X, there's a big number shown in the logs]
So the solution is
If you don't do this, then your app will eat up a lot of RAM even if it doesn't crash.
Regards,
Debayan