Cordova 4.3.0 Error: Please install Android target: “android-21”

I have a project that is running well with ripple emulator, but when i try to launch it on a physical Android device, I get the following error :

Error: Please install Android target: “android-21″.

  • Android record exists() in database?
  • How to handle MonoDroid uncaught exceptions globally and prevent application from crash
  • Update Navigation drawer listview
  • How do i disable installed version of Google Play services on my android device?
  • Add PhoneStateListener
  • how to change actionbarsherlock menu item font face when using custom theme for actionbar?
  • Hint: Open the SDK manager by running: C:\Program\ Files\ (x86)\Android\android-
    sdk\tools\android.BAT

    You will require:

    1. “SDK Platform” for android-21
    2. “Android SDK Platform-tools (latest)
    3. “Android SDK Build-tools” (latest)

    ERROR running one or more of the platforms: Error: cmd: Command failed with exit code 2
    You may not have the required environment or OS to run this project

    The device I’m using is on Android 4.2.2. The sdk installed on my computer is the 4.4.2 (API 19) :
    android skd

    I don’t understand why my app doesn’t lauch on my device.

    Related posts:

    Show DialogFragment from onActivityResult
    What happens if the Parse cloud data service fails?
    What's the meaning of new @SystemApi annotation, any difference from @hide?
    Data directory has no read/write permission in Android
    Open source for Android game development
    Error:Plugin with id 'com.github.dcendents.android-maven' not found
  • android tests often stall at 'instantiating tests'
  • Elevation not working for ImageView
  • Detect screenshot attempts on Android 4.0+
  • Some of Bootstrap3 glyphicons are not displayed correctly on phonegap android webview
  • Cannot find the class file for java.lang.Object
  • Is it possible to play music during calls so that the partner can hear it ? Android
  • 5 Solutions collect form web for “Cordova 4.3.0 Error: Please install Android target: “android-21””

    I’m simply compiling two existing answers, which are both required to solve the problem.

    Go to

    project folder -> platforms -> android -> AndroidManifest.xml
    

    find something like

    <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="21" />
    

    and change the 21 to 19.

    Then go to

    project folder -> platforms -> android -> project.properties
    

    and change

    target=android-21
    

    to

    target=android-19
    

    You should also edit the file platforms/android/project.properties and input the correct target.

    Go to

     project folder -> platforms -> android -> AndroidManifest.xml
    

    find something like

    <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="19" />
    

    you will see it’s targetSdkVersion is 21. make that 19 and run for now. To go with 21, update your android tools.

    You should install the following packages

    1. Android SDK Platforms-tools (Latest)
    2. Android SDK build-tools (Latest)
    3. SDK Platform (api 22)

    For your reference please see the screenshot attached belowenter image description here

    I had the same problem. I found it was the name of the project which posed the problem because it contained special characters like ‘&’.

    So I renamed my project with a simple name and it works very well now.

    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.