我已經構建了一個Phonegap應用程序,現在正試圖將它與Phonegap Build集成。我遵循非常簡單的指南here。無法從命令行構建Phonegap項目
所以我做:
sudo npm install -g phonegap
sudo phonegap create hello com.example.hello HelloWorld
cd hello
sudo phonegap local build android
最後的命令導致錯誤:
The command `android` failed. Make sure you have the latest Android SDK installed, and the `android` command (inside the tools/ folder) added to your path. Output: /bin/sh: 1: android: not found
我那麼做:
which android
與結果:
/home/mark/Development/adt-bundle-linux-x86_64-20130522/sdk/tools/android
這是一條路徑。
phonegap版本是3.1.0-0.15.0。
任何想法,爲什麼我得到這個錯誤?
編輯 如果我運行:
sudo phonegap local build /home/mark/Development/adt-bundle-linux-x86_64-20130522/sdk/tools/android
我得到另一個錯誤:
/usr/local/lib/node_modules/phonegap/lib/phonegap/local.build.js:141
platformPath = path.join('.', 'platforms', platform.local);
^
TypeError: Cannot read property 'local' of undefined
at LocalBuildCommand.module.exports.addPlatform (/usr/local/lib/node_modules/phonegap/lib/phonegap/local.build.js:141:60)
at LocalBuildCommand.execute (/usr/local/lib/node_modules/phonegap/lib/phonegap/local.build.js:95:32)
at LocalBuildCommand.run (/usr/local/lib/node_modules/phonegap/lib/phonegap/local.build.js:70:10)
at Object.build (/usr/local/lib/node_modules/phonegap/lib/phonegap/util/command.js:28:25)
at CLI.module.exports (/usr/local/lib/node_modules/phonegap/lib/cli/local.build.js:34:20)
at CLI.module.exports [as argv] (/usr/local/lib/node_modules/phonegap/lib/cli/argv.js:66:17)
at Object.<anonymous> (/usr/local/lib/node_modules/phonegap/bin/phonegap.js:24:21)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:349:32)
當您在命令行中輸入「android」時會得到什麼? – Purus
它帶來了android sdk管理器... – user1716672
是Ant安裝和配置的嗎? – Purus