Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skottie causing crashes on Android release build only on Expo SDK 51 #52

Open
idrakimuhamad opened this issue Jun 19, 2024 · 3 comments

Comments

@idrakimuhamad
Copy link
Contributor

We've recently upgrade expo SDK 51 and didn't realise this as it only happened in release build. However, the crash are rather hard to pin-point because the only trace in sentry/crashlytics is [TypeError: undefined is not a function]. It doesn't show at which line and which function, and doesn't point that to skottie at all.

At first I thought it was reanimated issue, then I suspect it to be Skia. Anything that have the Canvas will crash the app instantly. Not until I found this issue..

After replacing all skotie instance with rn-lottie, the issue gone away.

I will try to create a repro tomorrow, if that's needed.

@enestatli
Copy link

enestatli commented Jul 27, 2024

Hi everyone,

I am also experiencing the same issue with react-native-skottie on Android in release mode. I started a new project with the latest Expo SDK 51, and my app crashes at launch with the error below in logcat, but without any specific trace pointing to skottie.

07-27 13:29:50.483 17945 17974 E ReactNativeJS: TypeError: undefined is not a function, js engine: hermes
07-27 13:29:50.484 17945 17974 E ReactNativeJS: TypeError: Cannot read property 'ErrorBoundary' of undefined
07-27 13:29:50.484 17945 17974 E ReactNativeJS:
07-27 13:29:50.484 17945 17974 E ReactNativeJS: This error is located at:
07-27 13:29:50.484 17945 17974 E ReactNativeJS:     in SceneView
07-27 13:29:50.484 17945 17974 E ReactNativeJS:     in RCTView
07-27 13:29:50.484 17945 17974 E ReactNativeJS:     in Unknown
...

After removing skottie usage, the issue was resolved.

Here are my configurations for reference:

Proguard Rules

# react-native-reanimated
-keep class com.swmansion.reanimated.** { *; }
-keep class com.facebook.react.turbomodule.** { *; }

# react-native-skia
-keep class com.shopify.reactnative.skia.** { *; }

# react-native-skottie
-keep class com.skiaskottie.** { *; }

# hermes
-keep class com.facebook.hermes.unicode.** { *; }
-keep class com.facebook.jni.** { *; }

# react-native-svg
-keep public class com.horcrux.svg.** {*;}

#https://github.com/react-native-device-info/react-native-device-info/issues/1607
-keep class com.android.installreferrer.api.** {
  *;
}

#https://github.com/react-native-device-info/react-native-device-info#proguard
-keep class com.google.android.gms.common.** {*;}


# expo.modules.kotlin.views.GroupViewManagerWrapper.createViewInstance
# Fatal Exception: java.lang.ClassCastException: android.view.View cannot be cast to android.view.ViewGroup
# https://github.com/expo/expo/issues/20122#issuecomment-1337041362
-keep class expo.modules.** { *; }

package.json

 "dependencies": {
    ...
    "@shopify/react-native-skia": "^1.2.3",
    "expo": "~51.0.18",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-native": "0.74.3",
    "react-native-reanimated": "~3.10.1",
    "react-native-skottie": "^2.1.4",
    ...
  }

@davidwinograd1
Copy link

any solution?

@AdamGerthel
Copy link

AdamGerthel commented Oct 21, 2024

Same issue for me, see Shopify/react-native-skia#2430 (comment)

Will be moving to lottie-react-native as this breaking production right now. Let me know if you want any other types of logs or tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants