我正在尝试在 android studio 3.3 中运行“第一个应用程序”应用程序。我的连接是通过代理。当我尝试运行“第一个应用程序”时,android studio 显示下一个错误:
错误:无法获取“ https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.2.71/kotlin-gradle-plugin-1.2.71.pom ”。从服务器收到状态码 407:需要身份验证
启用 Gradle“离线模式”并同步项目
我已经在“文件/设置 - > HTTP 代理”中设置了我的代理并尝试了“检查连接”按钮。此链接“ https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.2.71/kotlin-gradle-plugin-1.2.71.pom ”工作正常。
我还取消选中“设置/构建,执行.../Gradle”中的“离线工作”复选框并再次同步项目,但它仍然显示相同的问题。
我只在“File/Settings -> HTTP Proxy”设置代理,够吗?还有地方吗?
在“build.gradle”文件中有这样的内容:
buildscript {
ext.kotlin_version = '1.2.71'
repositories {
mavenCentral()
google()
jcenter()
}
dependencies {
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 {
mavenCentral()
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
我该如何解决这个错误?谢谢。