Lottiefiles crashes on Android [SDK 34]

Hi all,

Having a problem with Lottiefiles animations in my Expo App.

I downloaded some animations from https://lottiefiles.com and added them to the with lottie-react-native (~2.6.1). They work (and look) great in the iOS simulator. However when I run the app in the Android simulator (in the Expo client) the app crashes without any error message or stacktrace.

Someone having experience with this and is able to help?

1 Like

Same problem. Need some help

1 Like

I use that one "lottie-react-native": "^3.1.0" but it gives me a warning.
it works well.

Updating to "lottie-react-native": "^3.1.0" isn’t changing anything for me. Maybe it has something to do with the imageAssetsFolder that is presumably required for Android. lottie-react-native/api.md at master · lottie-react-native/lottie-react-native · GitHub

But I have no idea what the assets folder is in an Expo app. And beside that, I don’t think my animations are using any assets because they will just run on iOS.

What version expo are you using? Please share us some more information :slight_smile: thank you.

SDK 34 (see topic title :wink:) And tested with "lottie-react-native": "^3.1.0" and with the expo install lottie-react-native which is ~2.6.1.

Example lottie file that I’am using and which will crash on Android:
https://assets2.lottiefiles.com/packages/lf20_QuPSrk.json

1 Like

I’m using SDK 34, check out my full package.json I hope it helps

{
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "eject": "expo eject"
  },
  "dependencies": {
    "@ant-design/react-native": "^3.1.13",
    "expo": "^34.0.1",
    "expo-asset": "~6.0.0",
    "expo-av": "~6.0.0",
    "expo-barcode-scanner": "~6.0.0",
    "expo-constants": "~6.0.0",
    "expo-contacts": "~6.0.0",
    "expo-facebook": "~6.0.0",
    "expo-font": "~6.0.1",
    "expo-google-sign-in": "~6.0.0",
    "expo-image-picker": "~6.0.0",
    "expo-linear-gradient": "~6.0.0",
    "expo-local-authentication": "~6.0.0",
    "expo-permissions": "~6.0.0",
    "expo-sqlite": "~6.0.0",
    "lottie-react-native": "^3.1.0",
    "react": "16.8.3",
    "react-dom": "^16.8.6",
    "react-native": "https://github.com/expo/react-native/archive/sdk-34.0.0.tar.gz",
    "react-native-fetch-polyfill": "^1.1.3",
    "react-native-gesture-handler": "^1.3.0",
    "react-native-indicators": "^0.13.0",
    "react-native-masked-text": "^1.13.0",
    "react-native-modal-datetime-picker": "^7.5.0",
    "react-native-modalbox": "^1.7.1",
    "react-native-paper": "^2.16.0",
    "react-native-push-notification-popup": "^1.3.0",
    "react-native-qrcode": "^0.2.7",
    "react-native-qrcode-svg": "^5.1.2",
    "react-native-raw-bottom-sheet": "^2.0.2",
    "react-native-svg": "~9.5.1",
    "react-native-text-input-mask": "^1.0.6",
    "react-native-timeline-listview": "^0.2.3",
    "react-native-web": "^0.11.4",
    "react-navigation": "^3.11.1",
    "react-navigation-material-bottom-tabs": "^1.0.0",
    "react-redux": "^7.1.0",
    "redux": "^4.0.4",
    "redux-logger": "^3.0.6",
    "redux-thunk": "^2.3.0",
    "socket.io-client": "^2.1.1"
  },
  "devDependencies": {
    "babel-preset-expo": "^6.0.0"
  },
  "private": true
}

1 Like

Thanks for your sharing!!!

@dankuanmei Ah now I see, you were not asking me :blush: Have you already tested the package.json posted by @woohgo

@woohgo Do you want to test whether the following animation works in your project on Android? https://assets2.lottiefiles.com/packages/lf20_QuPSrk.json

I’ve tried your json file, and it is not working, I think your json is incorret, maybe your designer has to change sth. try to upload your json to https://lottiefiles.com/ so we can see it working.

Thank you for testing! The animation is actually from https://lottiefiles.com/ and you can find it here. There it’s just working fine as it is also working as expected on iOS. So I don’t think the json or animation is incorrect. So the question remains why do some animations not work on Android?

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.