Search code examples
androidcordovaphonegap-buildphonegap

cordova build android give error "The system cannot find the path specified."


I am new to cordova. I have successfully created my first project using

cordova create FirstProject com.phonegappro.hello HelloWorld

cordova platform add android

cordova build android I am getting following error.

D:\wamp\www\FirstProject>cordova build android
ANDROID_HOME=C:\Users\Santosh\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_131
The system cannot find the path specified.
Error: cmd: Command failed with exit code 1

what I am doing wrong ? I have android studio installed. phonegab and cordova are latest with Node js higher v6.10.2


Solution

  • The problem was with the Gradle. Previously I had uninstalled android studio. And now again when I install it there was two folder for Android studio. Android Studio and Android Studio 1 by default it was trying to access the Gradle inside the Android Studio which was empty. I deleted it and renamed the Android Studio 1 to Android Studio.

    path : C:\Program Files\Android\Android Studio

    It worked for me.