Ionic在Windows上:安装了Android SDK。仍然收到“错误:请安装Android目标:”android-22“ [英] Ionic on Windows: Android SDK installed. Still get "Error: Please install Android target: "android-22"

查看:732
本文介绍了Ionic在Windows上:安装了Android SDK。仍然收到“错误:请安装Android目标:”android-22“的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经设法打破了以前的工作版本的Ionic环境。例如:我下载演示项目sidemenu并运行离子平台添加android没有任何问题。当我尝试运行离子生成我得到以下消息:

I have managed to break my previously working version of the Ionic enviroment. For example: I download the demo project "sidemenu" and run "ionic platform add android" without any problem. When I try to run "ionic build" I get the following message:

$ ionic build
Running command: "c:\Program Files\nodejs\node.exe" h:\git\Absolut\hooks\after_p
repare\010_add_platform_class.js h:/git/myapp add to body class: platform-android
Running command: cmd "/s /c "h:\git\Absolut\platforms\android\cordova\build.bat"
"
[Error: Please install Android target: "android-22".

Hint: Open the SDK manager by running: c:\Users\nicsj\AppData\Local\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\nicsj\AppData\Roaming\npm\node_modules\co
rdova\node_modules\cordova-lib\src\cordova\superspawn.js:134:23)
    at ChildProcess.emit (events.js:110:17)
    at maybeClose (child_process.js:1015:16)
    at Process.ChildProcess._handle.onexit (child_process.js:1087:5)

我不明白是什么原因的错误消息,因为android-22已经安装。我有SDK平台工具和构建工具以及。他们在PATH:

I don't understand what causes the error message since android-22 is already installed. I have the SDK Platform-tools and build-tools as well. They are on the PATH:

.../c/Program Files (x86)/Java/jdk1.7.0_71/bin:/c/Users/nicsj/AppData/Local/Android/android-sdk/tools:/c/Users/nicsj/AppData/Local/Android/android-sdk/build-tools/22.0.1:/c/Users/nicsj/AppData/Local/Android/android-sdk/platform-tools

离子设置:

Cordova CLI: 5.1.1
Gulp version:  CLI version 3.9.0
Gulp local:
Ionic CLI Version: 1.6.4
Ionic App Lib Version: 0.3.8
OS: Windows 7 SP1
Node Version: v0.12.5

Android SDK:

Android SDK:

C:\Users\nicsj>android list targets
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, W
XGA720, WXGA800, WXGA800-7in
 Tag/ABIs : no ABIs.
----------
id: 2 or "android-23"
     Name: Android 6.0
     Type: Platform
     API level: 23
     Revision: 1
     Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, W
XGA720, WXGA800, WXGA800-7in
 Tag/ABIs : no ABIs.

这个问题是新的,我不知道是什么原因造成的。

This problem is new and I don't know what caused it. Any advice on where I should look?

推荐答案

首先,对我的虚拟英语抱歉。
我只是有同样的问题,我修正它改变目标:

First of all, sorry for my dummy english. I just had the same problem and I fix it changing the target:

# Project target.    
target=android-22 (I had set this to android-23)

在两个文件中完成:

yourApp/platforms/android/project.properties    
yourApp/platforms/android/CordovaLib/project.properties

清单也应该更新:

<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="23" />

这篇关于Ionic在Windows上:安装了Android SDK。仍然收到“错误:请安装Android目标:”android-22“的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆