ionic2 cordova build android - Unable resolve gradle 2.2.3


Faced  this problem when trying to build android using ionic2/cordova. Seems like com.android.tools.build:gradle:2.2.3 is not listed in maven.org (but is available in jcenter).

I was able to compile and run it using Android studio 2.  Would still trying to find a better solution here.

* What went wrong:
  A problem occurred configuring root project ''.
  > Could not resolve all dependencies for configuration ':classpath'.
> Could not find com.android.tools.build:gradle:2.2.3.
 Searched in the following locations:
     file:/home/ubuntu/.m2/repository/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.pom
     file:/home/ubuntu/.m2/repository/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.jar
     https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.pom
     https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.jar
     https://oss.sonatype.org/content/repositories/snapshots/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.pom
     https://oss.sonatype.org/content/repositories/snapshots/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.jar
 Required by:
     :<myproject>:unspecified


After some time, this error comes from CordovaLib (reference projects for Cordova). To resolve this, I edit "build.gradle", remove mavenCentral to make it look like code below :-



Next, i was able issue 'cordova compile" or "ionic build android" to build my project successfully. (You can't use ionic command as it would replace the entire project file).

Problem solved! :) Unless, you completed remove Android source in platform folder.


Update : This is fixed in Ionic Framework release 2.0.0













Comments

Hannah Baker said…
Thank you for your post.Hawkscode is a one of the best
mobile application development comapny

Popular posts from this blog

The specified initialization vector (IV) does not match the block size for this algorithm