What went wrong:
A problem occurred evaluating root project ‘android’.
Failed to apply plugin [id ‘com.android.application’]
Minimum supported Gradle version is 4.1. Current version is 3.4.1. If using the gradle wrapper, try editing the distributionUrl in /usr/src/app/gradle/wrapper/gradle-wrapper.properties to gradle-4.1-all.zip
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 33.044 secs
Error: /usr/src/app/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred evaluating root project ‘android’.
Failed to apply plugin [id ‘com.android.application’]
Minimum supported Gradle version is 4.1. Current version is 3.4.1. If using the gradle wrapper, try editing the distributionUrl in /usr/src/app/gradle/wrapper/gradle-wrapper.properties to gradle-4.1-all.zip
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Failed to build apk check logs above for errors.
Running after script…
$ clean-up
Cleaning up files…
Successful clean up
ERROR: Job failed: exit status 1
the android package still fails. but now the error is different:
Checking the license for package Android SDK Platform 26 in /opt/android-sdk/licenses
Warning: License for package Android SDK Platform 26 not accepted.
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project ‘android’.
You have not accepted the license agreements of the following SDK components:
[Android SDK Platform 26].
Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager.
Alternatively, to learn how to transfer the license agreements from one workstation to another, go to Exporting licenses - Android Studio Project Site
So although you are on the current cordova-android now you are getting the Gradle error again? Then I would say again that this is something support should look at: http://ionicframework.com/support#support
That worked for me. I had upgraded Gradle from Android Dev environment and had the build issue.
removing the android platform manually, then re-adding fixed it.