我收到
Failed to resolve: com.github.dogecoin:libdohj:v0.15.9
错误,但我不知道为什么。我还尝试了其他 jitpack 依赖项。在我之前的项目中效果很好。
buildscript {
ext {
compose_version = '1.0.2'
}
repositories {
google()
maven { url "https://jitpack.io" }
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.2"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.21"
classpath "com.google.dagger:hilt-android-gradle-plugin:2.38.1"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
我将
maven { url "https://jitpack.io" }
添加到了 settings.gradle 中,它解决了问题。
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
jcenter() // Warning: this repository is going to shut down soon
maven { url "https://jitpack.io" }
}
}
rootProject.name = "Crypto World"
include ':app'
在Gradle的新版本(7.2)中,一些部分发生了变化,所以你需要这样做:
1-检查您的
gradle
版本
2- 打开
build.gradle(project:---)
3- 如果像下面的代码,请转到下一步
plugins {
id 'com.android.application' version '7.1.2' apply false
id 'com.android.library' version '7.1.2' apply false
}
task clean(type: Delete) {
delete rootProject.buildDir
}
4- 打开
stting.gradle(---)
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
}
5-立即同步并完成
Gradle 8.4 依赖项使用 TOML Kotlin
setting.gradle.kts
,这里,必须注册jitpack:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}