Issue on Gradle download .. How to fix it?


#1

Friends,

I am using ionic 3 in Ububtu 18.04 version . When I try to build apk
I got error as

ysadmin@dell:~/mgov$ cordova run android
Android Studio project detected
ANDROID_HOME=/home/sysadmin/Android/Sdk
JAVA_HOME=/usr/lib/jvm/java-8-oracle
studio
Subproject Path: CordovaLib
Subproject Path: app
Downloading https://services.gradle.org/distributions/gradle-4.1-all.zip

Exception in thread "main" java.net.UnknownHostException: services.gradle.org
	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
	at java.net.Socket.connect(Socket.java:589)
	at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:673)
	at sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:173)
	at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)
	at sun.net.www.protocol.https.HttpsClient.<init>(HttpsCli

Here problem is

**Downloading https://services.gradle.org/distributions/gradle-4.1-all.zip

Exception in thread “main” java.net.UnknownHostException: services.gradle.org**

my ionic info is

cli packages: (/home/sysadmin/mgov/node_modules)

    @ionic/cli-plugin-proxy : 1.5.7
    @ionic/cli-utils        : 1.19.2
    ionic (Ionic CLI)       : 3.20.0

global packages:

    cordova (Cordova CLI) : 8.0.0 

local packages:

    @ionic/app-scripts : 3.1.9
    Cordova Platforms  : android 7.0.0 browser 5.0.3
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 26.1.1
    Node              : v8.10.0
    npm               : 3.5.2 
    OS                : Linux 4.15

Environment Variables:

    ANDROID_HOME     : /home/sysadmin/Android/Sdk
    HTTP_PROXY       : not set
    http_proxy       : http://172.16.8.4:8080/
    HTTPS_PROXY      : not set
    https_proxy      : http://172.16.8.4:8080/
    IONIC_HTTP_PROXY : not set
    PROXY            : not set
    proxy            : not set

Misc:

    backend : pro

My ~/.bashrc file content relevant to this is

# Added ANDROID_HOME variable.
export ANDROID_HOME=/home/sysadmin/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/tools 
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/bin
export PATH=/opt/gradle/gradle-4.1/bin:$PATH
#export CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL="./gradle-4.1-all.zip"


Please advise … I am tired to look this gradle issue…

Thanks

Anes