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.
@curtismartintransloc Does this happen on all devices?
We've seen it happen on the two devices we have in house running 7.0, a Nexus 6 and an LG Aristo.
Hello, maybe it can help, got same exception for the following lottie
3d_0146.zip.
Devices are Samsungs s8 and j7 (both android 7.0)
Reproduced on hardware layer type only.
@disparate Are you sure your S8 is on 7.0? Did you flash it back to that/never upgrade it?
It also happen to in Samsung S7(android 7.0)
I updated Lottie 2.7.0 to 3.1.0.
It was fine in 2.7.0 but it happened after updating.
It is the same as the latest version of 3.3.0.
@frogsm Can you try using software rendering? Part of the upgrade set the render mode to AUTO and it went from software to hardware rendering.
@disparate Are you sure your S8 is on 7.0? Did you flash it back to that/never upgrade it?
@gpeal Yes, I checked it. Happens only on 7.0 definitely. Never upgraded.
Has this issue been resolved? I am also facing crash issue in Android 7.0 devices. All devices.
Has this issue been resolved? I am also facing crash issue in Android 7.0 devices. All devices.
@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.
Any updates on that?
Still happens with version 3.4.0 and software rendering.
Has this issue been resolved? I am also facing crash issue in Android 7.0 devices. All devices.
@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.
I removed hardware acceleration configuration from manifest. What hardware acceleration does is to smoothen the graphics rendering process. After disabling it, my lottie were little slower but it solved the crash issue
I am also facing the same issue in all 7.0 version devices. Any solution? Using lottie:3.4.0 version.
I am also facing the same issue in all 7.0 version devices. Any solution? Using lottie:3.4.0 version.
I removed hardware acceleration configuration from manifest. What hardware acceleration does is to smoothen the graphics rendering process. After disabling it, my lottie were little slower but it solved the crash issue
I am also facing the same issue in all 7.0 version devices. Any solution? Using lottie:3.4.0 version.
I removed hardware acceleration configuration from manifest. What hardware acceleration does is to smoothen the graphics rendering process. After disabling it, my lottie were little slower but it solved the crash issue
In Manifest file it is already false android:hardwareAccelerated="false"
Also programmatically when needed I put below code to enable it, still crashing in 7.0
if (Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.N_MR1) {
getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED,
WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
}
@Mihir3646 No need to do that at a global level. You can tell Lottie to render with software with setRenderMode
@Mihir3646 No need to do that at a global level. You can tell Lottie to render with software with
setRenderMode
@gpeal Thank you, let me try with your mention solution. If working fine I will update here.
@gpeal I had this problem in React Native, but this property is not actually exposed from the native side, I made an RP to expose this property, I tried it and it works 🎉
https://github.com/react-native-community/lottie-react-native/pull/654
@Mihir3646 No need to do that at a global level. You can tell Lottie to render with software with
setRenderMode
Still Happening
full stacktrace
#00 pc 0000000000065b7a /system/lib/libhwui.so
#01 pc 000000000006514d /system/lib/libhwui.so
#02 pc 0000000000064cdb /system/lib/libhwui.so
#03 pc 00000000000245fd /system/lib/libhwui.so
#04 pc 00000000000262d1 /system/lib/libhwui.so
#05 pc 000000000002a969 /system/lib/libhwui.so (android::uirenderer::renderthread::RenderThread::threadLoop()+80)
#06 pc 000000000000e349 /system/lib/libutils.so (android::Thread::_threadLoop(void)+140)
#07 pc 00000000000678b7 /system/lib/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void)+102)
#08 pc 0000000000048293 /system/lib/libc.so (__pthread_start(void*)+22)
#09 pc 0000000000019cfd /system/lib/libc.so (__start_thread+6)
Good question, I would like to know that too. I think this question
should be referred to https://github.com/gpeal. please let me know if you
find out anything.
cheers,
Orit
בתאריך יום ד׳, 19 באוג׳ 2020 ב-8:12 מאת JD Porterfield <
[email protected]>:
@oritgurel https://github.com/oritgurel I noticed you had a merged PR
for this change. Was curious if there was a planned release/release date
for the next Lottie version?—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/airbnb/lottie-android/issues/1453#issuecomment-675855321,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AGK75IPRA3QASIDPAUTNYOLSBNNM5ANCNFSM4JVOGIHQ
.
@gpeal is there a planned release/release date for the next Lottie version?
This appears to be released in v3.4.2, can anyone verify the fix and close this ticket if it is working?
3.4.2 just changed the default but setting render mode to software has always been an option. I'm going to close this and using software rendering for problematic devices or sticking to the new default which is software for 7.0 is the recommended path forward.
Most helpful comment
@Mihir3646 No need to do that at a global level. You can tell Lottie to render with software with
setRenderMode