本文主要是介绍AS提示:Connection timed out: connect. If you are behind an HTTP proxy,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
AS使用手机热点时 IDE提示:Connection timed out: connect. If you are behind an HTTP proxy, please configure the proxy settings either in IDE or Gradle.
分别在buildscript中的repositories和allprojects中的repositories添加如下代码
maven() {
url 'https://maven.aliyun.com/repository/jcenter'
}
maven(){
url 'https://maven.aliyun.com/repository/google'
}
maven {
url 'https://maven.aliyun.com/repository/public'
}
maven {
url 'https://maven.aliyun.com/repository/mapr-public'
}
添加完成后保存,重启AS
AS恢复正常
参考build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.buildscript {repositories {maven() {url 'https://maven.aliyun.com/repository/jcenter'}maven(){url 'https://maven.aliyun.com/repository/google'}maven {url 'https://maven.aliyun.com/repository/public'}maven {url 'https://maven.aliyun.com/repository/mapr-public'}google()jcenter()}dependencies {classpath 'com.android.tools.build:gradle:4.0.0'// NOTE: Do not place your application dependencies here; they belong// in the individual module build.gradle files} }allprojects {repositories {maven() {url 'https://maven.aliyun.com/repository/jcenter'}maven(){url 'https://maven.aliyun.com/repository/google'}maven {url 'https://maven.aliyun.com/repository/public'}maven {url 'https://maven.aliyun.com/repository/mapr-public'}google()jcenter()} }task clean(type: Delete) {delete rootProject.buildDir }
这篇关于AS提示:Connection timed out: connect. If you are behind an HTTP proxy的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!