我设法打破了我以前工作的版本的离子环境.例如:我下载演示项目“sidemenu”并运行“离子平台添加
android”没有任何问题.当我尝试运行“离子版本”时,我得到以下消息:
$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 Platform-tools和build-tools.他们在路上:
.../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:
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,WXGA800-7in Tag/ABIs : no ABIs.
这个问题是新的,我不知道是什么原因造成的.任何关于我应该看的建议?