我在跑步:ionic cordova build android
抛出以下stacktrace:
...org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
...java.net.ConnectException: Connection timed out: connect
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
我支持公司代理,这可能是问题吗?
答案 0 :(得分:1)
要让gradle通过代理访问互联网,请在platforms/android
文件夹中的gradle.properties
文件中创建(如果不存在则创建)添加以下内容:
systemProp.http.proxyHost=<your proxy ip or host>
systemProp.http.proxyPort=<your proxy port>
systemProp.http.proxyUser=<ur user if any>
systemProp.http.proxyPassword=<ur pass if any>
systemProp.https.proxyHost=<your proxy ip or host>
systemProp.https.proxyPort=<your proxy port>
systemProp.https.proxyUser=<ur user if any>
systemProp.https.proxyPassword=<ur passif any>
PS:请注意,如果您使用cordova/ionic
重新生成平台项目,该文件将被覆盖。