I don't know found a solution. I will write mine.
- In your project go android/app/build.gradle
final lottieVersion = "2.8.0"
Declare final lottie version after
import com.android.build.OutputFile
- In same place you have to add this line to
dependencies {
here will be some
implementation [ ... ]
we will add implementation 'com.airbnb.android:lottie:$lottieVersion'
- After this steps we will add these lines to our
launch_screen.xml
we need a raw directory for our lottie json's. Create a directory under the res directory named raw and put your lottie animation into the raw folder.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background_splash">
<com.airbnb.lottie.LottieAnimationView
android:id="@+id/animation_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:lottie_rawRes='@raw/loading_chat'
app:lottie_loop="true"
app:lottie_autoPlay="true"
/>
</LinearLayout>
This guide for react native >= 60 , Thanks