18. My app is crashing on Android
Several users have reported crashes on Android due to errors. The latest versions of React Native have refined this process, and updating these should fix the issue, but if this is not a possibility, you can manually link the required libraries as follows:
- On your
android/app/src/main/java/<YourAppName>/MainApplication.java
, addimport com.airbnb.android.react.lottie.LottiePackage;
at the top. - In the same file, add
packages.add(new LottiePackage());
underList<ReactPackage> getPackages()
. - On your
android/app/build.gradle
, addimplementation project(':lottie-react-native')
inside the dependencies section. - On your
android/settings.gradle
, addinclude ':lottie-react-native'
. - Right after the line you just added, add
project(':lottie-react-native').projectDir = new File(rootProject.projectDir, '../node_modules/lottie-react-native/src/android')
.
Now, you should rebuild your...