0

I am new to ionic and its build. When I build the app for android I get Error code 1 for command: cmd with args:

E:\Native\crunchyv3\app>ionic build android
Running command: "C:\Program Files\nodejs\node.exe"
E:\Native\crunchyv3\app\hooks\after_prepare\010_add_platform_class.js
E:\Native\crunchyv3\app
ANDROID_HOME=C:\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_102\

FAILURE: Build failed with an exception.

* Where:
Build file 'E:\Native\crunchyv3\app\platforms\android\build.gradle' line: 22

* What went wrong:
A problem occurred evaluating root project 'android'.
> Failed to apply plugin [id 'android']
> Minimum supported Gradle version is 2.14.1.  Current version is 2.2.1. If using the gradle wrapper, try editing the distributionUrl in
E:\Native\crunchyv3\app\gradle\wrapper\gradle-wrapper.properties to gradle-2.14.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: 12.134 secs
Error: Error code 1 for command: cmd with args: /s,/c,"E:\Native\crunchyv3\app\platforms\android\gradlew cdvBuildDebug -b
E:\Native\crunchyv3\app\platforms\android\build.gradle -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"

I searched for the error over the net but couldn't find a solution. I downgraded ionic to 1.7.14 and tried but still the same issue. Any suggestions or solutions?

1 Answers1

0

It looks like gradle is outdated:

> Minimum supported Gradle version is 2.14.1.  Current version is 2.2.1.

I think you just need to open Android Studio and it will show a popup saying that a new version of gradle is available, or you can find some suggestions here: How to update gradle in android studio. After that just re-add the android platform to your ionic project.

Community
  • 1
  • 1