Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I am very new to Ionic2 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**

enter image description here

like image 975
Debo Avatar asked May 19 '17 13:05

Debo


2 Answers

just downgrade your android version to 5

cordova platform rm android

then

cordova platform add android@~5

it worked for me.

like image 161
Pravesh Negi Avatar answered Sep 20 '22 07:09

Pravesh Negi


I got the same issue and used this command to build project to display entire log with which it is failing,

cordova build -d

it will show gradle path ,sdk path being used to run. In my case, gradle path was not present.

like image 23
Saurabh Avatar answered Sep 20 '22 07:09

Saurabh