Cordova build android error : The system cannot find the path specified. Error: cmd: Command failed with exit code 1


#1

I am very new to Ionic 3 app development and am trying to build an Android app with it. I want to run the app in Visual Studio emulator and am getting the below error while running ‘cordova build android’ command. Please help with it! Thanks in advance!

**C:\Devlopment ionic\sample\sampleapp>cordova build android
ANDROID_HOME=C:\Users\d.dutta.chowdhury\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**

#2

You didn’t install Android with all its dependencies correctly. Does C:\Program Files\Java\jdk1.8.0_131 exist?

In general it is better and easier to install all that stuff by just installing Android Studio.


#3

Yes this file C:\Program Files\Java\jdk1.8.0_131 exist, about the android I install it, but I add some version of the android 26 to 22


#4

This shouldn’t be a file but a folder.

I suggest you install Android Studio as this will take care of most of this automatically.


#5

I did I install the android has is like you say but still the same issued I don’t know is a version issued

this is my versions
1 java version "1.8.0_131"
2 node v6.11.0
3 ionic 3.4.0
4 cordova 7.0.1


#6

Please run dir "C:\Program Files\Java\jdk1.8.0_131" and give us the output.


#7

So sorry I am new in all this in the console of windows you mean ???


#8

Yes, where you also were running the ionic commands.


#10

well I fix I, format mi pc install all back now is working thanks you