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 app/build.gradle.kts file is the Kotlin-DSL Gradle build script for the lottie-kt-test app module. It configures the Android namespace, SDK versions, Java compile options, release build optimisations, and all runtime dependencies — including the com.airbnb.android:lottie:6.7.1 library that powers the animation rendering in this demo.

Android Block

The android { } block declares the core build identity and SDK targeting for the app.
namespace
String
Sets the application’s R class package and is used as the base package for generated resources.
namespace = "com.srm.lottiee"
compileSdk
compileSdk block
Specifies the Android API level used to compile the app. The project uses a release preview SDK declared with a minor API level:
compileSdk {
    version = release(37) {
        minorApiLevel = 1
    }
}
This targets the latest available release SDK at the time of authoring while keeping targetSdk pinned to 36 for Play Store compatibility.
defaultConfig.applicationId
String
The globally unique identifier for the app on a device and on the Google Play Store. This must never change after the app is published.
applicationId = "com.srm.lottiee"
defaultConfig.minSdk
Int
The minimum Android API level required to install and run the app. API level 24 corresponds to Android 7.0 (Nougat).
minSdk = 24
defaultConfig.targetSdk
Int
The API level the app is designed and tested against. Setting targetSdk = 36 opts the app into all behaviour changes introduced up to Android 16.
targetSdk = 36
defaultConfig.versionCode
Int
An internal integer version number used by the Play Store to determine upgrade eligibility. Must be incremented with every release.
versionCode = 1
defaultConfig.versionName
String
The human-readable version string shown to users on the store listing and in device settings.
versionName = "1.0"

Compile Options

The compileOptions { } block ensures consistent Java bytecode compatibility across the build toolchain.
compileOptions {
    sourceCompatibility = JavaVersion.VERSION_11
    targetCompatibility = JavaVersion.VERSION_11
}
OptionValueMeaning
sourceCompatibilityJavaVersion.VERSION_11The Kotlin/Java source code may use language features up to Java 11
targetCompatibilityJavaVersion.VERSION_11The compiler emits bytecode targeting the Java 11 class file format
Setting both to VERSION_11 enables Java 11 APIs (such as String.isBlank() and List.copyOf()) and is required by many AndroidX libraries from 2023 onward.

Release Build Type

The release { } block configures the production build artefact with code shrinking, resource shrinking, and native-library packaging options.
isMinifyEnabled
Boolean
When true, R8 (the Android build tool successor to ProGuard) removes unused classes, methods, and fields from the compiled bytecode, reducing APK/AAB size and making reverse engineering harder.
isMinifyEnabled = true
isShrinkResources
Boolean
When true, the resource shrinker removes unused drawables, layouts, strings, and other resources from the final artefact. Must be used together with isMinifyEnabled = true.
isShrinkResources = true
A commented-out line in the file (// isShrinkResources = false // Just in AAB Release) serves as a reminder that resource shrinking may need to be disabled when building an Android App Bundle (AAB) for certain store configurations.
proguardFiles
vararg files
Specifies the ProGuard / R8 rule files applied during minification. Two files are provided:
  • proguard-android-optimize.txt — the default Android optimisation rules bundled with the build tools.
  • proguard-rules.pro — the project-specific rules file where custom keep rules can be added (e.g. to protect Lottie assets or reflection-dependent classes).
proguardFiles(
    getDefaultProguardFile("proguard-android-optimize.txt"),
    "proguard-rules.pro"
)
packaging.jniLibs.useLegacyPackaging
Boolean
When false, native .so libraries are stored uncompressed inside the APK/AAB and loaded directly from the package, reducing runtime memory usage. This is the recommended setting for API 23+.
packaging {
    jniLibs {
        useLegacyPackaging = false
    }
}

Dependencies

The full dependencies { } block is reproduced below. The Lottie library is the only non-AndroidX third-party dependency.
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")  // ← Lottie dependency
}
The Lottie dependency is declared as a hardcoded string coordinate ("com.airbnb.android:lottie:6.7.1") rather than via the version catalog (libs.*), which is a common pattern when adding one-off dependencies outside the catalog.
With isShrinkResources = true enabled, the resource shrinker may incorrectly strip Lottie animation JSON files or image assets if they are not referenced from code in a way the shrinker can trace statically. Add explicit keep rules to proguard-rules.pro to protect any assets loaded by filename string (e.g. "wh.json", "logo2.json") or any Lottie classes accessed via reflection. Failure to do so can result in a release build that silently fails to display animations.

Build docs developers (and LLMs) love