简体   繁体   中英

How to install Android target in windows

I've installed Android SDK directly from Google's developer website, and I've installed All 16 packages which was checked to be installed in Android SDK manager by default.
SDK tools 24.3.4, 23.0.1, 21.0.1, 20, Build tools 23.0.1, SDK platform 23 and some other items. I also have a android-sdk\\platform-tools folder sized 9.24 MB.

But still I'm getting this error while running:

cordova build android

the error:

[Error: Please install Android target: "android-21"
...
1. "SDK Platform" for android-21
2. "Android SDK Platform-tools (latest)
3. "Android SDK Build-tools" (latest)]

What should I install to solve this problem?

you will have to use sdk manager to download targets other then bundled by default.

You can launch the SDK Manager in one of the following ways:

  • From the Android Studio File menu: File > Settings > Appearance & Behavior > System Settings > Android SDK.
  • From the Android Studio Tools menu: Tools > Android > SDK Manager.
  • From the SDK Manager icon ( 在此处输入图片说明 ) in the menu bar.

您已经安装了足够的文件,转到build.gradle文件,然后将compileSdkVersion更改为22,或者将23更改为已安装的任何文件。

android-21 is an indicator for Android API level 21, which means Android 5.0 (Lollipop).

Here is the entire list of API levels .

So you need to either:

  1. Install the Android 5.0 package through the SDK Manager that comes with the Android SDK bundle.

  2. Change the target of your project to one of the SDKs you do have installed, asuuming that there are no API 21 specific code in said project.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM