Adding maven { url "https://jitpack.io" }
Asked Answered
T

2

10

How can I add maven { url "https://jitpack.io" } in settings.gradle.kts??

a red line appears under the url, the error says: Unexpected tokens (use ';' to separate expressions on the same line)

How can I solve this, please?

enter image description here

Tenne answered 12/8, 2023 at 10:15 Comment(0)
C
33

As of Android Koala, the format should be like this

dependencyResolutionManagement {
    repositories {
        maven {
            url = uri("https://jitpack.io")
        }
    }
}
Cunningham answered 12/8, 2023 at 10:18 Comment(1)
Thanks, It Works For me. build.gradle -version plugins { id("com.android.application") version "8.1.4" apply false id("com.android.library") version "8.1.4" apply false id("org.jetbrains.kotlin.android") version "1.9.0" apply false }Inequity
G
2

Inside "settings.gradle.kts" file please add like this:

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        maven {
            url = uri("https://jitpack.io")
        }
    }
}
Greenness answered 24/4, 2024 at 13:27 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.