AMS
AMS

Reputation: 133

Cordova 3.4.0 Install Error- Please Install Android Target 19

I'm attempting to add the android platform to my cordova project using

cordova platform add android

However, I receive the following error:

Error: Please install Android target 19 (the Android newest SDK). Make sure you have the
latest Android tools installed as well. Run "android" from your command-line to 
install/update any missing SDKs or tools.

As the message suggested, I have used the android command to install all of the updates. In addition to this, I have also added the following to my path variable:

%ANT_HOME%\bin;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools;%JAVA_HOME%\bin

Other responses to similar questions I found online suggested setting the target variable in the project.properties file to

target=android-19

I have tried all of these in the past few days, but I'm unable to get past this error. What else can I try to fix this? I'm running Windows 8.1 64-bit, by the way.

EDIT:

Just wanted to add more info- when I run

android list target

I get the following output

Available Android targets

id: 1 or "android-19"
     Name: Android 4.4.2
     Type: Platform
     API level: 19
     Revision: 3
     Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in
 Tag/ABIs : default/armeabi-v7a, default/x86
id: 2 or "Google Inc.:Google APIs x86:19"
 Name: Google APIs x86
 Type: Add-On
 Vendor: Google Inc.
 Revision: 4
 Description: Android + Google APIs x86
 Based on Android 4.4.2 (API level 19)
 Libraries:
  * com.android.future.usb.accessory (usb.jar)
      API for USB Accessories
  * com.google.android.media.effects (effects.jar)
      Collection of video effects
  * com.google.android.maps (maps.jar)
      API for Google Maps
 Skins: WVGA800 (default), WVGA854, WSVGA, WXGA720, HVGA, WXGA800-7in, QVGA, WQVGA400, WQVGA432, WXGA800
 Tag/ABIs : default/x86
id: 3 or "Google Inc.:Google APIs:19"
 Name: Google APIs
 Type: Add-On
 Vendor: Google Inc.
 Revision: 4
 Description: Android + Google APIs
 Based on Android 4.4.2 (API level 19)
 Libraries:
  * com.android.future.usb.accessory (usb.jar)
      API for USB Accessories
  * com.google.android.media.effects (effects.jar)
      Collection of video effects
  * com.google.android.maps (maps.jar)
      API for Google Maps
 Skins: WVGA800 (default), WVGA854, WSVGA, WXGA720, HVGA, WXGA800-7in, QVGA, WQVGA400, WQVGA432, WXGA800
 Tag/ABIs : default/armeabi-v7a

Upvotes: 4

Views: 6540

Answers (6)

ʞᴉɯ
ʞᴉɯ

Reputation: 5594

My solution was to add the Android SDK Build-tools 19, other than the 19.1 one!

enter image description here

Upvotes: 0

ray
ray

Reputation: 8699

I followed Bhavin's answer which may have helped, but I couldn't get this to work till I did two things:

  1. run android.bat and install this guy: enter image description here

  2. open find_java.bat in %ANDROID_HOME%\tools\lib\ and change this line:

    for /f "delims=" %%a in ('"%~dps0\find_java.exe" -s') do set java_exe=%%a

to this:

set java_exe=%JAVA_HOME%\java.exe 

Looking for nuances in the System/Environmental vars started making my eyes cross. When I saw android.bat call the find_java.bat, I altered find_java to echo the java path. It found java.exe in my System32 dir. That java.exe does not run, but since it was there, android would try to use it.

Upvotes: 1

Bhavin Dhalwani
Bhavin Dhalwani

Reputation: 11

I was Having the Same Error : Please install Android target 19

* Reason * Environment variables path not defined/Incorrect/Missing some characters

* Solution * Windows: Add the platform-tools\ directory to your Windows path: ;

C:\Development\Android\android-sdk-windows\platform-tools\

NOTE: The last "\" at the end of the Path variable has to be included.

MAC: Update the PATH variable to point to the Android SDK Platform-tools directory in the /etc/rc.common file or ~/.bash_profile:

PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/libexec:/System/Library/CoreServices:/Developer/usr/bin:~/Development/Android/android-sdk-macosx/tools:~/Development/Android/android-sdk-macosx/platform-tools:export PATH

LINUX: Update your PATH to point to the Android SDK Platform-tools directory. If you use bash shell, add the following to ~/.bashrc :

export PATH=/opt/android-sdk-linux/tools/:/opt/android-sdk-linux/platform-tools/:$PATH

Upvotes: 1

nowRails
nowRails

Reputation: 267

I was having the same problem. I solved it by downloading the corresponding sources as well for the targets[Android L, Android 4.4W (API 20) and Android 4.4.2w (API 19)]

android list target

output:

Available Android targets:
----------
id: 1 or "android-19"
     Name: Android 4.4.2
     Type: Platform
     API level: 19
     Revision: 3
     Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in
 Tag/ABIs : default/armeabi-v7a, default/x86
----------
id: 2 or "android-20"
     Name: Android 4.4W
     Type: Platform
     API level: 20
     Revision: 1
     Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in, AndroidWearRound, AndroidWearSquare, AndroidWearRound, AndroidWearSquare
 Tag/ABIs : android-wear/armeabi-v7a, android-wear/x86
----------
id: 3 or "android-L"
     Name: Android L (Preview)
     Type: Platform
     API level: L
     Revision: 3
     Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in
 Tag/ABIs : android-tv/armeabi-v7a, android-tv/x86, default/armeabi-v7a, default/x86
----------
id: 4 or "Google Inc.:Glass Development Kit Preview:19"
     Name: Glass Development Kit Preview
     Type: Add-On
     Vendor: Google Inc.
     Revision: 8
     Description: Preview of the Glass Development Kit
     Based on Android 4.4.2 (API level 19)
     Libraries:
      * com.google.android.glass (gdk.jar)
          APIs for Glass Development Kit Preview
     Skins: WXGA800, WXGA800-7in, HVGA, WVGA800 (default), WQVGA400, QVGA, WSVGA, WQVGA432, WXGA720, WVGA854
 Tag/ABIs : no ABIs.
----------
id: 5 or "Google Inc.:Google APIs:19"
     Name: Google APIs
     Type: Add-On
     Vendor: Google Inc.
     Revision: 6
     Description: Android + Google APIs
     Based on Android 4.4.2 (API level 19)
     Libraries:
      * com.google.android.media.effects (effects.jar)
          Collection of video effects
      * com.android.future.usb.accessory (usb.jar)
          API for USB Accessories
      * com.google.android.maps (maps.jar)
          API for Google Maps
     Skins: WXGA800, WXGA800-7in, HVGA, WVGA800 (default), WQVGA400, QVGA, WSVGA, WQVGA432, WXGA720, WVGA854
 Tag/ABIs : default/armeabi-v7a
----------
id: 6 or "Google Inc.:Google APIs (x86 System Image):19"
     Name: Google APIs (x86 System Image)
     Type: Add-On
     Vendor: Google Inc.
     Revision: 6
     Description: Android x86 + Google APIs
     Based on Android 4.4.2 (API level 19)
     Libraries:
      * com.google.android.media.effects (effects.jar)
          Collection of video effects
      * com.android.future.usb.accessory (usb.jar)
          API for USB Accessories
      * com.google.android.maps (maps.jar)
          API for Google Maps
     Skins: WXGA800, WXGA800-7in, HVGA, WVGA800 (default), WQVGA400, QVGA, WSVGA, WQVGA432, WXGA720, WVGA854
 Tag/ABIs : default/x86

Upvotes: 2

nijin
nijin

Reputation: 556

For Windows, in the Environment Variable try place the java\bin directory before the windows\system32 directory.

This makes the SDK Manager to use java from java\bin directory else it would use java found in the system32 folder.

This should help!

Upvotes: 0

zizoujab
zizoujab

Reputation: 7800

I had the same issue with you and that error drove me crazy.

When I moved the call to android, ant and java variable paths to the System variable path not the user variable path it worked. hope the same happens to you.

Upvotes: 1

Related Questions