0

I have created a new ionic project following the instructions on ionic's site.

I followed these steps

ionic start myApp tabs

cd myApp

ionic platform add android

When running ionic serve - the project runs fine on my computer.

When I try to run ionic build android so that I can deploy to my phone I get the following error:

  • What went wrong:

A problem occurred configuring root project 'android'.

Could not resolve all dependencies for configuration ':classpath'.
Could not resolve com.android.tools.build:gradle:2.1.0.
Required by:
     :android:unspecified
Could not resolve com.android.tools.build:gradle:2.1.0.
Could not get resource 'https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.1.0/gradle-2.1.0.pom'.
Could not GET 'https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.1.0/gradle-2.1.0.pom'.
Unrecognized SSL message, plaintext connection?
Could not resolve com.android.tools.build:gradle:2.1.0.
Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.1.0/gradle-2.1.0.pom'.
Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.1.0/gradle-2.1.0.pom'.
Unrecognized SSL message, plaintext connection?

The first resource I could not GET https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.1.0/gradle-2.1.0.pom I see an xml page no 404 error.

The second link https://jcenter.bintray.com/com/android/tools/build/gradle/2.1.0/gradle-2.1.0.pom downloads the .pom file with no issues.

Not sure what to make of the Unrecognized SSL message, plaintext connection?

ionic version: 2.0.0

gradle version: 2.13

cordova version: 6.3.1
Edward Falk
  • 9,991
  • 11
  • 77
  • 112
kcameron
  • 21
  • 2

2 Answers2

2

Although I was on my home network and not on my company's vpn, my company computer uses Cisco Web Security which was blocking the two sites above.

kcameron
  • 21
  • 2
1

Try to turn off your firewall; helps if it is a network issue and any the URLs are blocked somehow.

Furthermore, I figured that Andriod studio itself have graddle issue. If you are using SDK installed via Andriod studio then first try resolving it. Here are some links that might help you.

Android Studio graddle 2.1.3 issue

and

Ionic build android failed with 403 Http respose from Gradle, JAVA_HOME not valid

And, you seem to have installed ionic 2.0 which uses angular 2.0 . This issue appears if you meant to use ionic 1.0 but have ionic CLI for 2.0.

Try the following

npm install -g ionic @1.x
ionic start myApp tabs
cd myApp    
ionic platform add android
ionic build android.

Good luck. Let me know if this doesn't work for you.

Community
  • 1
  • 1
Dinesh Devkota
  • 1,417
  • 2
  • 18
  • 45
  • Yes, this will solve an issue I have not run into yet since I do plan to use Angular 1. But it did not solve my current issue. Uninstalled and reinstalled ionic version 1.7.16 and had the same error message. – kcameron Sep 19 '16 at 00:32
  • Updated answer for you. Give it a try. – Dinesh Devkota Sep 19 '16 at 01:40
  • 1
    I temporarily turned off my firewall. My buildscript already had the repositories listed like the 1st links answer. I tried changing the distributionUrl as the 2nd link suggest but unfortunately I am still getting the same error. Will try on another computer tomorrow and update. – kcameron Sep 19 '16 at 02:25