错误安装 Android 目标 - Cordova CLI

Erro Install Android Target - Cordova CLI

我在我的 Mac Yosemite 中使用带有 Cordova Command CLI 的 Android SDK Studio 开发应用程序,但我发现添加平台错误 android在我的项目中。

正在执行的命令:cordova platform add android

错误:

/Users/roni/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/node_modules/q/q.js:126
                    throw e;
                          ^
Error: Please install Android target "android-19".
Hint: Run "android" from your command-line to open the SDK manager.
    at /Users/roni/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/lib/check_reqs.js:174:19
    at _fulfilled (/Users/roni/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/node_modules/q/q.js:798:54)
    at self.promiseDispatch.done (/Users/roni/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/node_modules/q/q.js:827:30)
    at Promise.promise.promiseDispatch (/Users/roni/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/node_modules/q/q.js:760:13)
    at /Users/roni/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/node_modules/q/q.js:574:44
    at flush (/Users/roni/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/node_modules/q/q.js:108:17)
    at process._tickCallback (node.js:442:13)
Error: /Users/roni/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/create: Command failed with exit code 8
    at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:766:16)
    at Process.ChildProcess._handle.onexit (child_process.js:833:5)

我的 Bash_profile

配置
export PATH=${PATH}:/Applications/Android\ Studio.app/sdk/platform-tools:/Applications/Android\ Studio.app/sdk/tools
export JAVA_HOME=$(/usr/libexec/java_home)
export PATH=${JAVA_HOME}/bin:$PATH
export PATH=/usr/local/bin:$PATH

在 Android SDK 中更新您的 SDK tools 和 "SDK build" 工具。使用 Eclipse ADT,它看起来像这张图片

安装 19 包

你可以试试这个

转到此目录

/Users/roni/.cordova/lib/npm_cache/cordova-android/3.6.4/package/framework

编辑project.properties 文件。将 target 更改为 19

# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system use,
# "ant.properties", and override values to adapt the script to your
# project structure.

# Indicates whether an apk should be generated for each density.
split.density=false
# Project target.
target=android-19
apk-configurations=
renderscript.opt.level=O0
android.library=true

重新启动您的终端。