airbnb / lottie-android

Render After Effects animations natively on Android and iOS, Web, and React Native
http://airbnb.io/lottie/
Apache License 2.0
34.95k stars 5.4k forks source link

Lottie JNI Crashes on play store deployed app #2452

Closed kunal-jar closed 7 months ago

kunal-jar commented 7 months ago

We use lottie extensively in our app and it has been crashing intermittently for Android 12 and some devices on production randomly. And we need to solve these crashes.

Stacktrace -

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 29857 >>> packageName <<<

backtrace:
  #00  pc 0x0000000000297f00  /system/lib64/libhwui.so (SkPath::addPath(SkPath const&, SkMatrix const&, SkPath::AddPathMode)+248)
  #01  pc 0x00000000003d498c  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (art_jni_trampoline+124)

Another one -

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 5848 >>> packageName <<<

backtrace:
  #00  pc 0x000000000004b750  /apex/com.android.runtime/lib64/bionic/libc.so (__memcpy+96)
  #01  pc 0x00000000002941a8  /system/lib64/libhwui.so (SkPathRef::growForVerbsInPath(SkPathRef const&)+108)
  #02  pc 0x0000000000293834  /system/lib64/libhwui.so (SkPath::addPath(SkPath const&, SkMatrix const&, SkPath::AddPathMode)+168)
  #03  pc 0x00000000003fc04c  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (art_jni_trampoline+124)

Another one -

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 17199 >>> packageName <<<

backtrace:
  #00  pc 0x000000000029826c  /system/lib64/libhwui.so (SkPath::addPath(SkPath const&, SkMatrix const&, SkPath::AddPathMode)+276)
  #01  pc 0x000000000034dc30  /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+144)
  #02  pc 0x0000000002796330  /memfd:jit-zygote-cache

Checklist

  1. Set useSafeMode to true to avoid crashes
  2. Use Logger.setInstance(CustomLogger()) and tried logging on firebase (Not a recommended way to set Logger)
  3. Found another issue for the same one - https://github.com/airbnb/lottie-android/issues/1947

Lottie version - 6.1.0 Android version - 12

Steps To Reproduce

Happens intermittently on play store production, but not easily reproducible.

It can also be related to lottie-compose, as we have that too in our app. Please suggest a way to use the safeModeApi in the compose as well

gpeal commented 7 months ago

Have you ever been able to reproduce the crash locally? Does it only happen with certain animations?

kunal-jar commented 7 months ago

We tried a lot with these specific devices, but not able to reproduce

kunal-jar commented 7 months ago

@gpeal any updates how can I use the safe mode api in compose Lottie?

gpeal commented 7 months ago

@kunal-jar not at the moment. I can add this at some point in the future. If you'd like this done faster, I do prioritize issues from sponsors or you can put up a PR yourself.

kunal-jar commented 7 months ago

@gpeal Opened a PR for the same #2455, please check

kunal-jar commented 7 months ago

@gpeal Can you also please release one version 6.3.1 with this change?