我该如何解决“无法解析配置':app:debugRuntimeClasspath'的所有文件”

问题描述 投票:0回答:1

当我第一次尝试运行java移动应用程序时,我开始收到以下错误。我在互联网上进行了很多研究,但没有一个替代方案是解决方案。我该如何解决这个问题?

错误:

Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find androidx.multidex:multidex:2.1.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/androidx/multidex/multidex/2.1.0/multidex-2.1.0.pom
       - https://repo.maven.apache.org/maven2/androidx/multidex/multidex/2.1.0/multidex-2.1.0.pom
       - https://jitpack.io/androidx/multidex/multidex/2.1.0/multidex-2.1.0.pom
     Required by:
         project :app
java android gradle
1个回答
0
投票

在settings.gradle(项目设置)中进行这些更改

dependencyResolutionManagement{
repositories{
    maven { url "https://jitpack.io" }
}
}

16

将jcenter()添加到setting.gradle(项目设置)中。

dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
    google()
    mavenCentral()
    jcenter() //here
}
}

在你的 Gradle 脚本 -> settings.gradle(项目设置) 每当您将依赖项添加到项目中时,请进行以下更改:

repositories{
mavenCentral()
maven {
        url 'https://jitpack.io'
    }
}
© www.soinside.com 2019 - 2024. All rights reserved.