Ionic build through proxy fails


#1

The error when enter a ionic cordova build android is:

java.io.IOException: Unable to tunnel through proxy. Proxy returns “HTTP/1.1 407 Proxy Authentication Required”

What exactly is the way to configure the proxy with authentication?

OS: Lubuntu 17.10 - 4.13.0-38-generic amd64
Ionic CLI: 3.20.0
NPM: 5.5.1
JVM: 1.8.0_161 (Oracle Corporation 25.161-b12)
Gradle: 3.2.1


#2

That depends on the proxy. Ask your system administrator.


#3

I am my own system administrator =)
All apps works, including apt, chrome, git, pidgin, teamviewer, atom package manager, etc.
Only Ionic cli fails… Thanks for your help


#4

I would fire myself then configuring a proxy that requires authentication but not knowing how to supply the credentials :wink:

(Tbh: I have no idea. Maybe as username:password@ before the hostname?)

What exactly is failing by the way? Is it really Ionic CLI? Or Cordova?)


#5
Running app-scripts build: --platform android --target cordova
[11:09:47]  build dev started ... 
[11:09:47]  clean started ... 
[11:09:47]  clean finished in 1 ms 
[11:09:47]  copy started ... 
[11:09:47]  transpile started ... 
[11:09:56]  transpile finished in 9.17 s 
[11:09:56]  preprocess started ... 
[11:09:56]  deeplinks started ... 
[11:09:56]  deeplinks finished in 64 ms 
[11:09:56]  preprocess finished in 66 ms 
[11:09:56]  webpack started ... 
[11:09:57]  copy finished in 9.81 s 
[11:10:07]  webpack finished in 11.02 s 
[11:10:07]  sass started ... 
[11:10:09]  sass finished in 1.69 s 
[11:10:09]  postprocess started ... 
[11:10:09]  removed unused font files 
[11:10:09]  postprocess finished in 18 ms 
[11:10:09]  lint started ... 
[11:10:09]  build dev finished in 22.55 s 

> cordova build android

You have been opted out of telemetry. To change this, run: cordova telemetry on.
ANDROID_HOME=/home/maxi/Android/Sdk
JAVA_HOME=/usr/lib/jvm/java-8-oracle
[11:10:46]  lint finished in 37.18 s 
:wrapper


BUILD SUCCESSFUL

Total time: 32.009 secs
Subproject Path: CordovaLib
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.

	at build_2v0c4fsq7kvccoz2fjmot4ms3.run(/home/maxi/Desarrollo/interno/platforms/android/build.gradle:141)
IOException: https://dl.google.com/android/repository/addons_list-3.xml
java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 407 Proxy Authentication Required"
IOException: https://dl.google.com/android/repository/addons_list-2.xml

java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 407 Proxy Authentication Required"
IOException: https://dl.google.com/android/repository/addons_list-1.xml
java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 407 Proxy Authentication Required"

Failed to download any source lists!
java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 407 Proxy Authentication Required"

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Failed to find Platform SDK with path: platforms;android-26


#6

Ok, so something triggered by cordova, probably via Gradle. I don’t know anything about how to configure proxies there :confused: