The command "platforms\android\cordova\clean.bat" exited with code 2

10,971

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

Share:
10,971

Related videos on Youtube

ANCHALOSE Y
Author by

ANCHALOSE Y

Software Engineer Email : [email protected]

Updated on June 04, 2022

Comments

  • ANCHALOSE Y
    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
    Knelis about 9 years
    Maybe you should specify what exactly should be put in the PATH environment variable.
  • Ashik
    Ashik almost 9 years
    Also make sure you have the appropriate/latest Android SDK Platform-tools and Build-tools
  • Jonathan Stark
    Jonathan Stark over 7 years
    I tried this, but it didn't work until I deleted the platforms\android\folder too