嗨,伙计们,这是我第一次在这里提问,但我曾经解决过很多检查这个网站的问题。有人能帮帮我吗?我想在我的图库中选择一张图片,并在单击按钮时对其进行充电。为此,我在https://github.com/Dhaval2404/ImagePicker中使用了github imagepciker依赖项。
我首先复制了gradle依赖项,现在我的gradle项目如下所示
我不得不删除错误中的一些链接,因为我的声誉低于10
buildscript {
repositories {
google()
maven { url "https://jitpack.io" }
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.0"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.20"
}
}然后,当我复制这个实现com.github.dhaval2404:imagepicker:2.1和/或这个实现com.github.dhaval2404:imagepicker-support:1.7.1时,我得到一个错误,它说
FAILURE: Build completed with 7 failures.
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find com.github.dhaval2404:imagepicker:2.1.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/github/dhaval2404/imagepicker/2.1/imagepicker-2.1.pom
- https://repo.maven.apache.org/maven2/com/github/dhaval2404/imagepicker/2.1/imagepicker-2.1.pom
- https://jcenter.bintray.com/com/github/dhaval2404/imagepicker/2.1/imagepicker-2.1.pom
Required by:
project :app
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================有人知道该怎么解决这个问题吗?
发布于 2021-10-28 05:47:30
对我来说,我在settings.gradle文件中添加了下面的代码
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
jcenter() // Warning: this repository is going to shut down soongoing to shut down soon
maven { url 'https://jitpack.io' }
}
}发布于 2021-08-09 04:43:49
由于您使用的是kotlin,因此需要在build.gradle (app)中添加androidx依赖项
即使用
implementation 'com.github.dhaval2404:imagepicker-support:1.7.1'在你的应用程序级别的build.gradle中,不要干扰项目级别的gradle文件
https://stackoverflow.com/questions/68704676
复制相似问题