Please provide the following:
- SDK Version: 35
- 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.