This is a solution to the above error that I want to document. I found other similar posts, but none described how this error can be associated with Cordova or Ionic.
I
I'd love to just leave this as a comment, but I'm apparently not reputable enough...
After reading your documentation, I wasn't able to resolve my issue with your suggestion of keeping the Android Studio to "Use default gradle wrapper". What I did find is that setting the session variable CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL before building got me a bit further:
root@dev:$ export CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL="https\://services.gradle.org/distributions/gradle-2.14.1-all.zip"
root@dev:$ cordova build android
The next thing I had to do was edit
and
and make sure they both pointed to a valid gradle plugin version.
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'
}
...and in
I added jcenter in the repositories (because maven.org did not seem to have 2.2.0)
repositories {
mavenCentral();
jcenter()
}
I was able to build then.