5
votes

Error message:

FAILURE: Build failed with an exception.

4

4 Answers

2
votes

Remove platforms/android folder and add Android again:

ionic platform add android
1
votes
buildscript {
    repositories {
        mavenCentral()
        maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
        jcenter()
    }
    dependencies {
    classpath 'com.android.tools.build:gradle:2.2.0'
    }

}

add jcenter() to your repositories. this worked for me.

1
votes

A bit late but as the other answers didn't work hopefully this will help others

Update your Android CordovaLib to the latest version

If this is not possible (or doesn't work) manually change the file

\platforms\android\CordovaLib\build.gradle and add in jcenter()

repositories {
    mavenCentral()
    jcenter()
}
0
votes
 buildscript {
    dependencies {
       classpath 'com.android.tools.build:gradle:2.2.0'
 }
}

try modifying these in your build.gradle . good luck