admin 管理员组

文章数量: 1103785

Gradle 打包 报错 Exception in thread “main” java.io.IOException: Unable to tunnel through proxy. Proxy returns"

  • Gradle 打包 报错 Exception in thread "main" java.io.IOException: Unable to tunnel through proxy. Proxy returns"
  • 解决方案
    • 方案1:
    • 方案2:

Gradle 打包 报错 Exception in thread “main” java.io.IOException: Unable to tunnel through proxy. Proxy returns"

Android Gradle 使用命令 gradlew 打包时,遇到错误Exception in thread “main” java.io.IOException: Unable to tunnel through proxy. Proxy returns
如图所示:

很明显,就是proxy代理设置出了问题。
但是,proxy 代理在哪里设置呢,从网上所有搜索文章来看,所有的解决方案都是叫你在以下目录去寻找
“C/Users/用户名/.gradle/gradle.properties”然后删除对应的代理或者重新设置代理地址,再试试
这里告诉大家。这个办法
不一定是对
的。

解决方案

方案1:

 依然在C/Users/用户名/.gradle/gradle.properties,中删除对应代理试试

方案2:

  如果方案1,依然不能解决问题
  请检查你工程里面 gradle/wrapper/gradle-wrapper.properties 文件中
  字段:“distributionBase=环境变量”,检查该环境变量的目录
  真正影响的你代理的配置文件就在这个目录下的gradle.properties中。
  找到后,删除相应的代理配置即可。再试试。




希望能帮助大家。

本文标签: 报错 Thread main Gradle Exception