首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >github依赖imagepicker的问题

github依赖imagepicker的问题
EN

Stack Overflow用户
提问于 2021-08-08 20:52:19
回答 2查看 655关注 0票数 1

嗨,伙计们,这是我第一次在这里提问,但我曾经解决过很多检查这个网站的问题。有人能帮帮我吗?我想在我的图库中选择一张图片,并在单击按钮时对其进行充电。为此,我在https://github.com/Dhaval2404/ImagePicker中使用了github imagepciker依赖项。

我首先复制了gradle依赖项,现在我的gradle项目如下所示

我不得不删除错误中的一些链接,因为我的声誉低于10

代码语言:javascript
复制
    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时,我得到一个错误,它说

代码语言:javascript
复制
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.
==============================================================================

有人知道该怎么解决这个问题吗?

EN

回答 2

Stack Overflow用户

发布于 2021-10-28 05:47:30

对我来说,我在settings.gradle文件中添加了下面的代码

代码语言:javascript
复制
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' }
}
}
票数 1
EN

Stack Overflow用户

发布于 2021-08-09 04:43:49

由于您使用的是kotlin,因此需要在build.gradle (app)中添加androidx依赖项

即使用

代码语言:javascript
复制
implementation 'com.github.dhaval2404:imagepicker-support:1.7.1'

在你的应用程序级别的build.gradle中,不要干扰项目级别的gradle文件

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68704676

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档