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

Download lotties json fies not working on expo android. #1187

Open
LucasJandrey5 opened this issue Feb 24, 2024 · 4 comments
Open

Download lotties json fies not working on expo android. #1187

LucasJandrey5 opened this issue Feb 24, 2024 · 4 comments

Comments

@LucasJandrey5
Copy link

Description

lotties json files that I downloaded from the website are not reproducing in expo android.

In my phone (Galaxy S23) the animation begin but stop in middle
On android simulator the app crashs

All animations works in https://lottiefiles.github.io/lottie-docs/playground/json_editor/

In json_editor the downloaded files have many errors but works

Steps to Reproduce

  1. Download json anim from Lottie Files site

Minimal reproduction

Code:

import LottieView from "lottie-react-native";

<LottieView
        source={require("./animation.json")}
        style={{ width: "100%", height: "50%" }}
        autoPlay
        loop
      />

Tested files:
animation.json
success.json
anim.json

React Native Environment

expo: "^49.0.23"
lottie-react-native: "^6.6.0"
react-native: "0.72.10"

package.json

Lottie Version

Version: ^6.6.0

@iatanasov37
Copy link

Hey, I had the same issue and found that as of the newer versions of Lottie React Native you need to do follow this Migration guide

I ended up with something like this:

  1. Created my own Animate bootstrapped Lottie:
// animated-lottieview.tsx

import LottieView from "lottie-react-native";
import { Animated } from "react-native"; //Use reanimated if you want to here

export const AnimatedLottieView = Animated.createAnimatedComponent(LottieView);
  1. Use it as a the regular Lottie view:
<AnimatedLottieView
        source={require("./animation.json")}
        style={{ width: "100%", height: "50%" }}
        autoPlay
        loop
/>
  1. Profit

I hope this helps.

@LucasJandrey5
Copy link
Author

LucasJandrey5 commented Feb 28, 2024

Hello, thanks for response

I tried your solution but not works, got same error

And tried with react-native-reanimated too

I try too follow step by step of expo docs:
https://docs.expo.dev/versions/latest/sdk/lottie/

But not works too.

Beetween the test interval, i reset cache and reinstal packages with npm install

@FESEVA
Copy link

FESEVA commented Apr 4, 2024

Same for me 😭
Tried with these combinations:

  • Expo 50

    • "lottie-react-native": "6.7.0"
    • "react-native": "0.73.6"
  • Expo 50

    • "lottie-react-native": "6.5.1"
    • "react-native": "0.73.5"
  • Expo 50

    • "lottie-react-native": "6.3.1"
    • "react-native": "0.73.5",

Its working on IOS but nothing is displayed on Android Emulator / Device

@bedirhangull
Copy link

Same issue :(
<LottieView autoPlay loop={true} ref={lottieRef} style={{ width: '100%', height: '100%', }} source={require('../../assets/animations/animation.json')} />

"expo": "~50.0.15",
"lottie-react-native": "6.5.1",

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

No branches or pull requests

5 participants