Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/tutosrive/lottie-kt-test/llms.txt

Use this file to discover all available pages before exploring further.

The Airbnb Lottie Android library (com.airbnb.android:lottie) is the engine that parses Lottie JSON files and renders them as scalable, hardware-accelerated animations inside a LottieAnimationView widget. This project uses version 6.7.1, which supports the full range of After Effects features exposed by the Bodymovin exporter and runs on API 16 and above.

Declaring the Dependency

Add a single implementation line inside the dependencies { } block of your app/build.gradle.kts:
app/build.gradle.kts
dependencies {
    implementation(libs.androidx.core.ktx)
    implementation(libs.androidx.appcompat)
    implementation(libs.material)
    implementation(libs.androidx.activity)
    implementation(libs.androidx.constraintlayout)
    testImplementation(libs.junit)
    androidTestImplementation(libs.androidx.junit)
    androidTestImplementation(libs.androidx.espresso.core)
    // Source: https://mvnrepository.com/artifact/com.airbnb.android/lottie
    implementation("com.airbnb.android:lottie:6.7.1")
}
The library is hosted on Maven Central. Modern Android Gradle Plugin (AGP) projects include Maven Central in their repository list by default, so no additional repositories { } block is required in either settings.gradle.kts or build.gradle.kts.
After adding the line, sync your project with Gradle (File → Sync Project with Gradle Files in Android Studio) and the library will be downloaded and indexed automatically.

Placing Animation Files

Lottie reads animation data from .json files bundled with the app. The standard location is app/src/main/assets/ — any file placed here is packaged into the APK and accessible at runtime by filename alone.
app/
└── src/
    └── main/
        └── assets/
            ├── wh.json first animation
            └── logo2.json second animation (switched at runtime)
This project uses two animations:
FilePurpose
wh.jsonDefault animation loaded on app launch
logo2.jsonAlternate animation swapped in by the Change button
If the assets/ folder does not exist yet, create it by right-clicking app/src/main in the Android Studio project view and selecting New → Directory → assets.
Lottie JSON files can be created in two ways: export them from Adobe After Effects using the free Bodymovin plugin, or browse and download ready-made animations from lottiefiles.com. Both sources produce files that drop straight into the assets/ directory.

Now that Lottie is on the classpath and your JSON files are in place, proceed to load and play an animation: Loading Animations

Build docs developers (and LLMs) love