The command "platforms\android\cordova\clean.bat" exited with code 2
Solution 1
In Visual Studio 2015, Menu: Tools => Options => Tools for Apache Cordova => Environment Variable Overrides set the correct ADT_HOME and JAVA_HOME.
Also Clean Cordova cache from the Cordova Tools. Then open and debug your project.
Solution 2
I ended in a similar issue when I installed the VS.Net2015 and tried to create a blank Cordova project and compile. I did try a lot of different things including reinstalling Android Studio and VS but none helped.
Finally what it boiled down to was that I had a 64Bit OS an installed a 32bit JDK which somehow didn't work well together. Downloaded the 64Bit JDK and corrected the Path in visual studio and now its working.
Regards Kiran
Related videos on Youtube
![ANCHALOSE Y](https://lh6.googleusercontent.com/-SmFtyCSJBek/AAAAAAAAAAI/AAAAAAAAACs/0saNr0ZYvjE/photo.jpg?sz=256)
Comments
-
ANCHALOSE Y about 2 years
While am debug my solution in Visual Studio 2015 Cordova this issue occured The command "platforms\android\cordova\clean.bat" exited with code 2.
-
Knelis about 9 yearsMaybe you should specify what exactly should be put in the
PATH
environment variable. -
Ashik almost 9 yearsAlso make sure you have the appropriate/latest Android SDK Platform-tools and Build-tools
-
Jonathan Stark over 7 yearsI tried this, but it didn't work until I deleted the
platforms\android\folder
too