问题描述
在 Android Studio Arctic Fox 版本中创建项目,原本应该在 build.gradle(Project) 中配置第三方 Maven 仓库,手动配置后居然报错:
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 xxxxxxxxxxxxxxxxxxx.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/xxxxx.pom
- https://repo.maven.apache.org/maven2/xxxxxx.pom
- https://jcenter.bintray.com/xxxxxxxx.pom
Required by:
project :app
解决方案
进入项目根目录的 settings.gradle 配置:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url '****写在这里****' }
jcenter() // Warning: this repository is going to shut down soon
}
}
|