Please install Android target

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Please install Android target相关的知识,希望对你有一定的参考价值。

今天在执行ionic build android时出现以下错误:
[Error: Please install Android target: "android-22".


Hint: Open the SDK manager by running: D:\\Program\\ Files\\ (x86)\\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


错误原因:工程属性配置文件中目标平台版本不一致。


解决方法:
1、确保系统已经安装了目标平台的API

技术分享

// 修改项目所在文件夹的以下3个文件,确保目标平台版本一致,如:
// # Project target.
// target=android-22
myApp/platforms/android/project.properties 
myApp/platforms/android/CordovaLib/project.properties
myApp/platforms/android/CordovaLib/AndroidManifest.xml


// AndroidManifest.xml文件修改如下
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="22" />

技术分享

以上是关于Please install Android target的主要内容,如果未能解决你的问题,请参考以下文章

Android Stuido启动提示"No JVM installation found.Please install a 32-bit JDK...."

Cannot find `aapt.exe`. Please install the Android SDK Build-tools package

Curses library not found. Please install appropriate package

phpize编译,Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF

如何处理错误消息Please install the Linux kernel header files

FATAL ERROR: please install th......Data::Dumper(未安装autoconf库)