2

I have the android-22 installed on my environmet. But still when running the cordova build android getting the following error:

C:\Work\WebRTC\FirstResponder\rtcommmobile>cordova build android Running command: C:\Work\WebRTC\nodejs\node.exe C:\Work\WebRTC\FirstResponder\rtcommmobile\hooks\after_prepare\ add to body class: platform-android Running command: C:\Work\WebRTC\nodejs\node.exe C:\Work\WebRTC\FirstResponder\rtcommmobile\hooks\after_prepare\ Running command: cmd "/s /c "C:\Work\WebRTC\FirstResponder\rtcommmobile\platforms\android\cordova\build.bat"" [Error: Please install Android target: "android-22".

Hint: Open the SDK manager by running: C:\Work\WebRTC\android\android-sdk\tools\android.BAT You will require: 1. "SDK Platform" for android-22 2. "Android SDK Platform-tools (latest) 3. "Android SDK Build-tools" (latest)] ERROR building one of the platforms: Error: cmd: Command failed with exit code 2 You may not have the required environment or OS to build this project Error: cmd: Command failed with exit code 2 at ChildProcess.whenDone (C:\Users\anatf\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\ at ChildProcess.emit (events.js:98:17) at maybeClose (child_process.js:766:16) at Process.ChildProcess._handle.onexit (child_process.js:833:5)

My system information is:

Running on Windows

Cordova CLI: 5.1.1 Ionic Version: 1.0.0-beta.14 Ionic CLI Version: 1.6.1 Ionic App Lib Version: 0.3.3 OS: Windows 7 SP1 Node Version: v0.10.35

Installed platforms: android 4.0.0, browser 3.5.2, ios 3.8.0 Available platforms: amazon-fireos, blackberry10, firefoxos, windows, windows8, wp8

Available Android targets:

id: 1 or "android-22" Name: Android 5.1.1 Type: Platform API level: 22 Revision: 2 Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in, AndroidWearRound, AndroidWearRound400x400, AndroidWearRoundChin320x290, AndroidWearSquare, AndroidWearSquare320x320, AndroidWearRound, AndroidWearRound400x400, AndroidWearRoundChin320x290, AndroidWearSquare, AndroidWearSquare320x320 Tag/ABIs : android-tv/armeabi-v7a, android-tv/x86, android-wear/armeabi-v7a, android-wear/x86, default/armeabi-v7a, default/x86, default/x86_64

Anyone can help me ?

hata
  • 11,633
  • 6
  • 46
  • 69
Anat Fradin
  • 29
  • 1
  • 2
  • Probably there are two different SDKs. Or you haven't installed SDK platform. Follow the instruction 'Open the SDK manager by running: C:\Work\WebRTC\android\android-sdk\tools\android.BAT You will require: 1. "SDK Platform" for android-22 2.' and make sure it is installed. – Bipin Bhandari Jul 21 '15 at 15:09

2 Answers2

1

As it was commented, there could be 2 different sdk's. Take a look at the c:/Users//android-sdks and c:/Users//AppData/Local/Android/android-sdks.

From what I can tell its referencing either of these and the one its referencing is missing the required files. Trying copying them across.

Karlta05
  • 165
  • 10
1

You need to check targetSdkVersion and minSdkVersion in project.properties files. You can find the full solution by going to the Sebastian G. Marinescu's answer here

Community
  • 1
  • 1
Vahid Farahmandian
  • 6,081
  • 7
  • 42
  • 62