但是,尝试从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中删除repos并将其添加到build.gradle中,如下所示:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}但还是有同样的问题
发布于 2021-09-21 11:45:45
您需要声明此库的版本的第一步。变化
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。
https://stackoverflow.com/questions/69268135
复制相似问题