Cordova平台与SDK API-19"添加android"失败

时间:2014-10-07 03:30:01

标签: android windows cordova

我正试图在我的Windows 7机器上使用cordova创建我的第一个android项目。我安装了最新的Android SDK(安装了API-19)和cordova。我为ANDROID_PATH,ANDROID_PLATFORM_TOOLS,ANDROID_TOOLS和ANT_HOME设置了路径。 使用来自http://cordova.apache.org/docs/en/3.6.0//guide_cli_index.md.html#The%20Command-Line%20Interface的指示我创建了“hello”项目,但是当我尝试使用以下命令添加android平台时:

cordova platform add android

从我的命令提示符android emulator打开显示android主屏幕,所以我可以浏览操作系统但很快关闭它我得到输出:

C:\devCenter\private\hello>cordova platform add android
Creating android project...

C:\Users\think ahead\.cordova\lib\npm_cache\cordova-android\3.6.3\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 C:\Users\think ahead\.cordova\lib\npm_cache\cordova-android\3.6.3\package\bin\lib\check_reqs.js:173:19
at _fulfilled (C:\Users\think ahead\.cordova\lib\npm_cache\cordova-android\3.6.3\package\bin\node_modules\q\q.js:798:54)
at self.promiseDispatch.done (C:\Users\think ahead\.cordova\lib\npm_cache\cordova-android\3.6.3\package\bin\node_modules\q\q.js:827:30)
at Promise.promise.promiseDispatch (C:\Users\think ahead\.cordova\lib\npm_cache\cordova-android\3.6.3\package\bin\node_modules\q\q.js:7
at C:\Users\think ahead\.cordova\lib\npm_cache\cordova-android\3.6.3\package\bin\node_modules\q\q.js:574:44
at flush (C:\Users\think ahead\.cordova\lib\npm_cache\cordova-android\3.6.3\package\bin\node_modules\q\q.js:108:17)
at process._tickCallback (node.js:419:13)
Error: cmd: Command failed with exit code 8
at ChildProcess.whenDone (C:\Users\think ahead\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Process.ChildProcess._handle.onexit (child_process.js:823:5)

C:\devCenter\private\hello>

“hello”项目中的平台内没有创建android目录。有人可以帮助我指出我遗失/做错的事。

SDK的Sceenshot sceenshot of SDK

Window在“cordova platform add android”上发布 Window launched on "cordova platform add android"

修改 添加环境值:

C:\devCenter\private\hello>set
ALLUSERSPROFILE=C:\ProgramData
ANDROID_HOME=C:\devCenter\sdk
ANDROID_PLATFORM_TOOLS=C:\devCenter\sdk\platform-tools
ANDROID_TOOLS=C:\devCenter\sdk\tools
APPDATA=C:\Users\think ahead\AppData\Roaming
CommonProgramFiles=C:\Program Files\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
CommonProgramW6432=C:\Program Files\Common Files
COMMPath=C:\Program Files\Lenovo\Communications Utility
COMPUTERNAME=THINKAHEAD
ComSpec=C:\Windows\system32\cmd.exe
configsetroot=C:\Windows\ConfigSetRoot
FP_NO_HOST_CHECK=NO
HerokuPath=C:\Program Files (x86)\Heroku
HOMEDRIVE=C:
HOMEPATH=\Users\think ahead
LOCALAPPDATA=C:\Users\think ahead\AppData\Local
LOGONSERVER=\\THINKAHEAD
NODE_PATH=;%NODE_PATH%;C:\Users\think ahead\AppData\Roaming\npm\node_modules;C:\Dev\Opa\lib\opa\stdlib;C:\Dev\Opa\lib\opa\stdlib\stdlib.qmljs;C:\Dev\Opa\lib\opa\static;C:\Users\think ahead\AppData\Roaming\npm\node_modules;C:\Dev\Opa\lib\opa\stdlib;C:\Dev\Opa\lib\opa\stdlib\stdlib.qmljs;C:\Dev\Opa\lib\opa\static;%APPDATA%\npm\node_modules
NUMBER_OF_PROCESSORS=8
OPABASEDIR=C:\Dev\Opa
OS=Windows_NT
Path=C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Dev\Opa\bin;C:\mongodb\bin;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\Common Files\Lenovo;C:\Program Files (x86)\Heroku\bin;C:\Program Files (x86)\git\cmd;C:\Program Files\TortoiseSVN\bin;C:\Program Files\MIT\Kerberos\bin;C:\Program Files\Lenovo\Bluetooth Software\;C:\Program Files\Lenovo\Bluetooth Software\syswow64;C:\Program Files\TortoiseGit\bin;C:\Program Files\nodejs\;C:\Ruby193\bin;C:\Windows\System32;C:\SocketeQ\windowsandroid_root\system\bin;C:\SocketeQ\windowsandroid_root\system\lib;C:\Program Files\MIT\Kerberos\bin;C:\Program Files (x86)\HMA! Pro VPN\bin;C:\Users\think ahead\AppDa
ta\Roaming\npm
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.JS;.JS;.RB;.RBW
PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 58 Stepping 9, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=3a09
ProgramData=C:\ProgramData
ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files
PROMPT=$P$G
PSModulePath=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
PUBLIC=C:\Users\Public
READYAPPS=C:\SWTOOLS\ReadyApps
SESSIONNAME=Console
SSH_AGENT_PID=371780
SSH_AUTH_SOCK=/tmp/ssh-vlsE376812/agent.376812
SWSHARE=C:\SWSHARE
SystemDrive=C:
SystemRoot=C:\Windows
TEMP=C:\Users\THINKA~1\AppData\Local\Temp
TMP=C:\Users\THINKA~1\AppData\Local\Temp
TVT=C:\Program Files (x86)\Lenovo
TVTCOMMON=C:\Program Files (x86)\Common Files\Lenovo
USERDOMAIN=thinkahead
USERNAME=think ahead
USERPROFILE=C:\Users\think ahead
VBOX_INSTALL_PATH=C:\Program Files\Oracle\VirtualBox\
VS100COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools\
windir=C:\Windows
WINDOWSANDROID_ROOT=C:\SocketeQ\windowsandroid_root
windows_tracing_flags=3
windows_tracing_logfile=C:\BVTBin\Tests\installpackage\csilogfile.log

0 个答案:

没有答案