Ionic 3 build Issue


#1

I have created the Ionic 3 app and also I have added the android platform to this application using the cmd ionic cordova platform add android but When I tried to build the apk file using the cmd ionic cordova build android I am getting this below issue

[18:23:50]  postprocess finished in 11 ms
[18:23:50]  lint started ...
[18:23:50]  build dev finished in 13.07 s
> cordova build android
[18:23:54]  lint finished in 3.29 s
ANDROID_HOME=C:\vinayakData\SDK
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_121
Error: Could not find an installed version of Gradle either in Android Studio,
or on your system to install the gradle wrapper. Please include gradle
in your path, or install Android Studio
[ERROR] An error occurred while running cordova build android (exit code 1).

Even though I have android sdk in my pc I am getting this issue.
I use nvm and in node v6.9.0 I am able to build apk but when I change my node v7.4.0 I am facing this issue and I have created this Ionic 3 application in node v7.4.0 only. Please help.


#2

The simplest solution is to install Android Studio. Otherwise, you have to install Gradle by yourself and add it to your environment variables.


#3

Thanks for replay @LoLStats
I installed the Gradle and added environment variable.


#4

But I never faced this issue before, Is it a Ionic 3 bug or what? because I am not using the Android Studio from the day I started to work on Ionic 1, I just used Android SDK Manager to build apk since than


#5

Probably off topic, but the current Node LTS is 8.9.0. Track 7 is discontinued.


#6

The Android SDK does not ship gradle by default anymore