2015-09-27 27 views
0

我已經從Google的開發者網站直接安裝了Android SDK,並且我已經安裝了默認情況下安裝在Android SDK管理器中的所有16個包。
SDK工具24.3.4,23.0.1,21.0.1,20,Build工具23.0.1,SDK平臺23等一些項目。我也有一個android-sdk \ platform-tools文件夾大小爲9.24 MB。如何在windows中安裝Android目標

但運行時我依然收到此錯誤:

cordova build android 

錯誤:

[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)] 

我應該怎麼安裝到解決這個問題?

回答

0

android-21是Android API級別21的一個指標,意味着Android 5.0(棒棒糖)。

Here is the entire list of API levels

所以,你需要:

  1. 通過自帶的Android SDK的SDK包管理器安裝的是Android 5.0包。

  2. 將項目的目標更改爲您已安裝的SDK之一,假設該項目中沒有API 21特定的代碼。

1

您將不得不使用sdk manager下載默認捆綁的其他目標。

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 (enter image description here) in the menu bar.
1

您已經安裝了足夠的,轉到build.gradle文件,並將compileSdkVersion更改爲22或23已安裝的任何東西。