[英]Error trying to add android platform to Cordova
我正在ubuntu 13.10上運行,並且已經使用npm安裝了cordova(如果有所不同)。 當我創建一個項目然后嘗試運行cordova platform add android
,出現以下錯誤:
/home/user/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:126
throw e;
^
Error: ERROR : executing command 'ant', make sure you have ant installed and added to your path.
at /home/user/.cordova/lib/android/cordova/3.4.0/bin/lib/check_reqs.js:47:27
at ChildProcess.exithandler (child_process.js:641:7)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Socket.<anonymous> (child_process.js:956:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:465:12)
Error: /home/user/.cordova/lib/android/cordova/3.4.0/bin/create: Command failed with exit code 8
at ChildProcess.whenDone (/usr/lib/node_modules/cordova/src/superspawn.js:112:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Process.ChildProcess._handle.onexit (child_process.js:810:5)
您需要安裝ANT 。
您可以通過運行命令sudo apt-get install ant
來做到這一點。
另一個常見問題:android sdk platform-tools和tools dir都必須在$ PATH中
您的實現可能會有所不同,但可能會有所不同:
export PATH=${PATH}:/Development/adt-bundle/sdk/platform-tools:/Development/adt-bundle/sdk/tools
source ~/.bash_profile
請參閱: Android平台指南
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.