解决Connection timed out: connect. If you are behind an HTTP proxy, please configure the proxy setting

今日卸载androidstudio2.3安装androidstudio4.0,安装好4.0创建项目时报错:Connection timed out: connect. If you are behind an HTTP proxy, please configure the proxy setting,与Android Studioand Gradle are using different locations forthe JDK。
1、先解决Android Studioand Gradle are using different locations forthe JDK:
解决Connection timed out: connect. If you are behind an HTTP proxy, please configure the proxy setting_第1张图片
解决Connection timed out: connect. If you are behind an HTTP proxy, please configure the proxy setting_第2张图片
将JDK location改为自己JAVA的JDK安装路径即可。
2、解决Connection timed out: connect. If you are behind an HTTP proxy, please configure the proxy setting:
将连接好后报错:
Could not GET ‘https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.5.3/gradle-3.5.3.pom’. Received status code 400 from server: Bad Request。
解决办法:
断开VPN,将gradle.properties文件中最后四行去掉即可,gradle.properties文件的路径为:C:\Users**.gradle\gradle.properties
解决Connection timed out: connect. If you are behind an HTTP proxy, please configure the proxy setting_第3张图片
保存gradle.properties文件,进入androidstudio进行Sync后项目创建成功!!

你可能感兴趣的:(解决Connection timed out: connect. If you are behind an HTTP proxy, please configure the proxy setting)