Error:Unknown host 'jcenter.bintray.com'. You may need to adjust the proxy settings in Gradle.

Android studio 报以下错误:

 Error:Unknown host 'jcenter.bintray.com'. You may need to adjust the proxy settings in Gradle.
 Enable Gradle 'offline mode' and sync 
 Learn about configuring HTTP proxies in Gradle

 我使用过的解决方案如下:(我的gradle版本是:classpath 'com.android.tools.build:gradle:3.2.1')

(1)在终端设置以下代理命令:

   gradlew -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=8580

   如下所示,输出结果:

Error:Unknown host 'jcenter.bintray.com'. You may need to adjust the proxy settings in Gradle._第1张图片

(2)再重新在as中try again 或者sync,可能会提示install 检测到的新的sdk,如下图所示:

Error:Unknown host 'jcenter.bintray.com'. You may need to adjust the proxy settings in Gradle._第2张图片

最后build成功,正常编译。

你可能感兴趣的:(Android,Studio,Android,Android,Android,Studio,Gradle)