Home > OS >  import lottie to gradle
import lottie to gradle

Time:03-18

I want to add lottie dependency in my project. this is the way that lottie document recommends

implementation "com.airbnb.android:lottie-compose:$lottieVersion"

allprojects {
repositories {
    ...
    maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}}

here is my gradle

buildscript {
ext {
    compose_version = '1.1.1'
    lottie_version = '0.5.4-SNAPSHOT'
}}
plugins {
id 'com.android.application' version '7.1.1' apply false
id 'com.android.library' version '7.1.1' apply false
id 'org.jetbrains.kotlin.android' version '1.6.10' apply false}
task clean(type: Delete) {
delete rootProject.buildDir}

as you can see there is no allProjects in my gradle.

how can I add Maven repository?

CodePudding user response:

Go to your build.gradle module and inside dependencies section add

implementation "com.airbnb.android:lottie-compose:$lottieVersion"

Now go in settings.gradle and inside dependencyResolutionManagement -> repositories add this

maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }

  • Related