Ionic cordova build --release android fails. Any help as to how to fix gradle problem in ionic build?


#1

FAILURE: Build failed with an exception.

  • Where:
    Build file ‘C:\Users\USAZ\Desktop\myProject\bookma\bookma\platforms\android\CordovaLib\build.gradle’ line: 41

  • What went wrong:
    A problem occurred evaluating project ‘:CordovaLib’.

Failed to apply plugin [id ‘com.android.library’]

Minimum supported Gradle version is 4.6. Current version is 4.1. If using the gradle wrapper, try editing the distributionUrl in C:\Users\USAZ\Desktop\myProject\bookma\bookma\gradle\wrapper\gradle-wrapper.properties to gradle-4.6-all.zip

  • Try:
    Run with --stacktrace
    option to get the stack trace. Run with --info or --debug option to get more log output.

  • Get more help at https://help.gradle.org

BUILD FAILED in 2m 29s
(node:14692) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

  • Where:
    Build file ‘C:\Users\USAZ\Desktop\myProject\bookma\bookma\platforms\android\CordovaLib\build.gradle’ line: 41

  • What went wrong:
    A problem occurred evaluating project ‘:CordovaLib’.

Failed to apply plugin [id ‘com.android.library’]
Minimum supported Gradle version is 4.6. Current version is 4.1. If using the gradle wrapper, try editing the distributionUrl in C:\Users\USAZ\Desktop\myProject\bookma\bookma\gradle\wrapper\gradle-wrapper.properties to gradle-4.6-all.zip

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

  • Get more help at https://help.gradle.org

BUILD FAILED in 2m 29s
(node:14692) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled
will terminate the Node.js process with a non-zero exit code.


#2

Can you build a new project created with ionic start?


#3

Let me try and see if that will resolve the issue


#4

That solves the problem. Thanks so much