Android studio3.6.1导入项目经常遇到:
Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all artifacts for configuration ':classpath'.
解决方案,在project的build.gradle 添加红色如下:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
google()
maven{url 'http://maven.aliyun.com/nexus/content/groups/public/'}
jcenter()
}
dependencies {
classpath 'com.google.gms:google-services:4.0.1'
classpath 'com.android.tools.build:gradle:3.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
maven{url 'http://maven.aliyun.com/nexus/content/groups/public/'}
jcenter()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
本文详细介绍了在使用Android Studio 3.6.1时,遇到的项目导入问题及解决方案。主要问题是配置':classpath'时无法解析所有依赖项,通过在build.gradle文件中添加特定的仓库和依赖项来解决。
1551

被折叠的 条评论
为什么被折叠?



