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

   如下所示,输出结果:

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

最后build成功,正常编译。

猜你喜欢

转载自blog.csdn.net/u010231454/article/details/83023015