Please set the goal of Android: "android-21"

I installed the last cordova. Version 4.3.0. I created an empty Cordoba project:

cordova create test com.test Test

Then I add the platform:

cordova platform add android

I built a project with:

cordova build android

But I always get:

[Error: Please install Android target: "android-21".

Hint: Open the SDK manager by running: C:\Program\ Files\     (x86)\Android\android-studio\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)]

So, I ran the “android” to confirm that I have the latest SDK installed: enter image description here

Then I tried to change the target Android-sdk to 19, so in AndroidManifest.xml I changed:

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

at

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

I ran the build command again and I still get the same error. It drives me crazy. Does anyone have any ideas? On the same computer, I created many cordova projects and had never seen this problem before.

+4
source share
4 answers

, , PATH Android SDK:

  • C:\Program Files\Android\sdk\tools
  • C:\Program Files\Android\sdk\platform-tools
+2

, , , , , "-" 22, 23, :

, , -22:   "target = android-22" "target = android-23"

: \\Android\project.properties \ \Android\CordovaLib\project.properties

+2

- , Android SDK, android . Cordova / SDK Android API 23 ( "-23" platforms/android/project.properties).

: android [*] :

  • "":
    • " Android SDK 23.1
    • " Android SDK 23.1
  • Android 6.0 (API 23)
    • SDK

cordova build android, .

[*] Assuming your sdk / tools path is on your PATH system (see here )

+2
source

Well, first you need to update the Android SDK tools and the Android SDK platform. You will then receive an update for API 21

+1
source

All Articles