Ionic cordova run android after error message


#1

Hi folks,
I run ionic cordova run android and i am getting error message and it says:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all files for configuration ':classpath'.
   > Could not resolve com.android.tools.build:gradle:3.0.0.
     Required by:
         project :
      > Could not resolve com.android.tools.build:gradle:3.0.0.
         > Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom'.
            > Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom'. Received status code 407 from server: Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied.  )
      > Could not resolve com.android.tools.build:gradle:3.0.0.
         > Could not get resource 'https://maven.google.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom'.
            >
Could not GET 'https://maven.google.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom'. Received status code 407 from server: Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied.  )

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 2s
(node:224) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all files for configuration ':classpath'.
   > Could not resolve com.android.tools.build:gradle:3.0.0.
     Required by:
         project :
      > Could not resolve com.android.tools.build:gradle:3.0.0.
         > Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom'.
            > Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom'. Received status code 407 from server: Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied.  )
      > Could not resolve com.android.tools.build:gradle:3.0.0.
         > Could not get resource 'https://maven.google.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom'.
            > Could not GET 'https://maven.google.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom'. Received status code 407 from server: Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied.  )

Ionic Info:

cli packages: (C:\Users\*****\AppData\Roaming\npm\node_modules)

    @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.8
    Cordova Platforms  : android 7.0.0
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 26.1.1
    Node              : v6.10.2
    npm               : 3.10.10
    OS                : Windows 10

Environment Variables:

    ANDROID_HOME : C:\Users\*****\AppData\Local\Android\Sdk

Misc:

    backend : pro

How to fix it?
I am waiting for your response.
Thanks in advance.


#2

Your Cordova tooling seems to be out of date, which might be causing all kinds of problems.
You can read about how to figure out the current Cordova versions and how to update CLI, platforms and plugins here: https://ionic.zone/cordova/update

Also: Is ionic cordova requirements happy?


#3

I have updated Cordova platforms:

Cordova Platforms  : android 7.1.0

ionic cordova requirements:

 ionic cordova requirements
> cordova requirements
Android Studio project detected


Requirements check results for android:

Java JDK: installed 1.8.0
Android SDK: installed true
Android target: installed android-27

Gradle: installed C:\Program Files\Android\Android Studio\gradle\gradle-4.1\bin\gradle

Now i run Ionic cordova run android:

Same error message


#4

Are you in a corporate environment with a web proxy?


#5

Oh yes i am using behind the proxy server.
I created gradle.properties and add proxy settings like this:

systemProp.https.proxyHost=*****.net
systemProp.https.proxyPort=8080

it fine but same error.


#6

Something is not working there, hence the error message. Your IT people should be able to help you debug that, they put the restriction in place and it is costing your employer a lot of money if you are not able to work because of it.


#7

I had the same issue with cordova android 7.0.0
I just removed the android platform and added it again with specific version.

ionic cordova platform add android@6.4.0

ultimately i downgraded the cordova android.
Try this may be it will solve your problem. :slightly_smiling_face: