lottie-android: Fatal signal 11 crash on Android 7.0
This has been happening for a little while for us apparently, but we don’t get crash logs reported from it since the crash seems to be occurring in native code. It happens on the latest version of Lottie (3.3.0) and previous ones.
We have an an animation that causes our app to crash whenever we play it forward or backward. It only crashes on devices running 7.0 (pre-7.0 and post-7.0, including 7.x.x are fine). Here’s what I’m seeing in the Logcat:
A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x4 in tid 7235 (RenderThread)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 3801, tid: 4185, name: RenderThread >>> com.transloc.microtransit.dev.debug <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x4
r0 8ed30730 r1 00000000 r2 00000044 r3 af30a4b1
r4 8e82b478 r5 8e82b478 r6 00000000 r7 849e4680
r8 8e82b278 r9 00000001 sl 8597bf00 fp 8e82b1c0
ip af369628 sp 8e82b110 lr af31a759 pc af34e29a cpsr a00f0030
backtrace:
#00 pc 0006329a /system/lib/libhwui.so
#01 pc 0006299b /system/lib/libhwui.so
#02 pc 000625d5 /system/lib/libhwui.so
#03 pc 00023e5f /system/lib/libhwui.so
#04 pc 000258b3 /system/lib/libhwui.so
#05 pc 00028d51 /system/lib/libhwui.so (_ZN7android10uirenderer12renderthread12RenderThread10threadLoopEv+80)
#06 pc 0000e3e5 /system/lib/libutils.so (_ZN7android6Thread11_threadLoopEPv+140)
#07 pc 00068a15 /system/lib/libandroid_runtime.so (_ZN7android14AndroidRuntime15javaThreadShellEPv+80)
#08 pc 000474e3 /system/lib/libc.so (_ZL15__pthread_startPv+22)
#09 pc 00019dcd /system/lib/libc.so (__start_thread+6)
I’ve reproduced the issue by starting a new empty project that only has a LottieAnimationView.
Here’s the layout:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<com.airbnb.lottie.LottieAnimationView
android:id="@+id/pin_button"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center"
app:lottie_fileName="pinning_animation.json" />
</FrameLayout>
And here’s the Activity:
package com.transloc.lottietest
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.airbnb.lottie.LottieAnimationView
import com.airbnb.lottie.RenderMode
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val pinButton = findViewById<LottieAnimationView>(R.id.pin_button)
pinButton.setOnClickListener {
pinButton.resumeAnimation()
}
}
}
The animation will play briefly, then the app will freeze momentarily, and then it will crash. I’ve found that setting the render mode to SOFTWARE will work around the issue.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 4
- Comments: 27 (2 by maintainers)
@Mihir3646 No need to do that at a global level. You can tell Lottie to render with software with
setRenderMode
@pranishres The workaround that you can proceed with if you want to use that lottie, is forcing SOFTWARE rendering on that lottie for android 7.0.
@gpeal
Hi@gpeal I use lottie 6.0.0,and setSoftMode RenderMode.SOFTWARE.In android 6.0 device have same problem。 Fatal signal 11 (SIGSEGV), code 1, fault addr 0x5c in tid 11244 (RenderThread)