Lottie Animation with Merge Paths

Please provide the following:

  1. SDK Version: 35
  2. Platforms(Android/iOS/web/all): Android

I’m having problem to use Lottie within Expo environment.
Steps to reproduce:

expo init TestingLottieExpo
# using blank template
# using yarn
cd TestingLottieExpo
expo install lottie-react-native
#success Saved lockfile.
#success Saved 4 new dependencies.
#info Direct dependencies
#└─ lottie-react-native@2.6.1
#info All dependencies
#├─ dedent@0.6.0
#├─ lottie-ios@2.5.0
#├─ lottie-react-native@2.6.1
#└─ react-native-safe-module@1.2.0

Then I edited the App.js.

import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import LottieView from 'lottie-react-native';

export default function App() {
  return (
    <View style={styles.container}>
      <Text>Open up App.js to start working on your app!</Text>

      <LottieView
        source={require('./assets/battery.json')}
        autoPlay
        enableMergePathsAndroidForKitKatAndAbove
      />
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fff',
    alignItems: 'center',
    justifyContent: 'center',
  },
});

Add the animation in the assets folder.
Then I start the expo and run on Android emulator.

Right after downloading the bundle, the app crashes.
Everything works normal in the iOS simulator.

Created a topic about a month ago with the same issue: Lottiefiles crashes on Android [SDK 34] Still no solution found…

There is also a github issue: [Android] Update Lottie After Upgrade >= RN0.60 · Issue #5559 · expo/expo · GitHub

What I think is that we need v3 of lottie-react-native to solve this problem, however that requires a react-native version 0.60.0 or higher and Expo is currently based on 0.59.8. I’am afraid we have to wait until Expo 36?

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