Visual Studio 2015 RC & Cordova build.bat: "Error: Please install Android target: "android-21""

845 Views Asked by At

Environment

  • VS 14.0.22823.1 D14REL

  • 64 bit JDK, manually installed; not using the one which comes with ADK

  • Windows 8.1

Problem

  • Create new Project of type "Appache Cordova Apps", leave default name "BlankCordovApp3"
  • Build the app with default settings: Works fine
  • Try to build the solution with BlankCordovApp3\platforms\android\cordova\build.bat in order to get more output
  • Error: Please install Android target: "android-21". Hint: Open the SDK manager by running: ... You will require:
    1. "SDK Platform" for android-21
    2. "Android SDK Platform-tools (latest)
    3. "Android SDK Build-tools" (latest)]` [Error: Please install Android target: "android-21". Hint: Open the SDK manager by running: ... You will require:
    4. "SDK Platform" for android-21
    5. "Android SDK Platform-tools (latest)
    6. "Android SDK Build-tools" (latest)]
1

There are 1 best solutions below

0
On

Solution

  • It is not a problem of the installed ADK levels.The problem persists even if the correct tools are installed through the Android SDK manager.
  • In my case, the problem was solved by adding the adk tools to the path (Control Panel => Environment Variables).

    C:\Users\userName\AppData\Local\Android\android-sdk\tools;C:\Users\userName\AppData\Local\Android\android-sdk\platform-tools;