After this, open the Xcode project configuration and add the Lottie.framework as Embedded
Binaries.
Android
For android, you can react-native link as well:
react-nativelinklottie-react-native
or you can add it manually:
settings.gradle:
build.gradle:
Lottie requires Android support library version 26. If you're using the react-native init
template, you may still be using 23. To change this, simply go to android/app/build.gradle and
find the compileSdkVersion option inside of the android block and change it to
You must also add the LottiePackage to getPackages() in your ReactApplication
Then, go to android/build.gradle and make sure it has :
With this change you should be ready to go.
Lottie's animation progress can be controlled with an Animated value:
Additionally, there is an imperative API which is sometimes simpler.
include ':lottie-react-native'
project(':lottie-react-native').projectDir = new File(rootProject.projectDir, '../node_modules/lottie-react-native/src/android')