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成功,正常编译。

更多相关文章

  1. Android利用Matrix简单处理图片
  2. android带有文字的图片按钮的两种实现方式
  3. 演化理解 Android 异步加载图片
  4. Android布局的一些属性和开关、创建log图片
  5. Android WebView实现选择本地图片拍照功能
  6. 很实用的android压缩图片的算法
  7. android imageView 图片显示方式属性
  8. Android 为联系人添加图片

随机推荐

  1. android自动化测试工具简介
  2. Android震动实现
  3. Android(安卓)universal-Image-Loader原
  4. Android(安卓)异步消息处理机制 让你深入
  5. Android: Your JS Engine is not always
  6. Android开源框架源码鉴赏:Okhttp
  7. Android(安卓)获取应用的icon、名字、版
  8. android studio 获取sha1和md5值
  9. Android(安卓)KTX简介
  10. Binder 与AIDL