不能使用 Jitpack 依赖

Can't use Jitpack dependencies

正在尝试使用 Jitpack 中的 ImagePicker,但即使按照添加依赖项的步骤,它也不会导入到我的代码中。

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 = "Flower Identifier v1"
include ':app'

build.gradle

dependencies {

implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.github.jkwiecien:EasyImage:Tag'
implementation 'com.github.Dhaval2404:ImagePicker:Tag'
}

未正确导入 ImagePicker:

还尝试从 settings.gradle 中删除存储库并将其添加到 build.gradle,如下所示:

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

但仍然有同样的问题

首先你需要声明这个库的版本。变化

implementation 'com.github.jkwiecien:EasyImage:Tag'
implementation 'com.github.Dhaval2404:ImagePicker:Tag'

到特定版本标签,如 implementation 'com.github.dhaval2404:imagepicker:2.1'

然后你可以删除

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

表格build.gradle.