Cordova在Ubuntu中添加平台错误

我有我的Ubuntu 13.10 x64文档文件夹中的Android最新的sdk工具。eclipse和sdk工作正常,也创build了一个虚拟设备。

cd Documents cd adt-bundle-linux-x86_64-20130514/ cd sdk/ ls -l 

它给了我这些,

 add-ons build-tools docs extras platforms platform-tools samples sources system-images temp tools 

现在用sudo apt-get install ant

然后编辑path,

 gedit ~/.bashrc 

最后添加了这个代码,

 #AndroidDev PATH export PATH=${PATH}:~/Documents/adt-bundle-linux-x86_64-20130514/sdk/tools export PATH=${PATH}:~/Documents/adt-bundle-linux-x86_64-20130514/sdk/platform-tools 

现在,当我试图添加Android平台的示例项目,它会抛出错误,

 cd hello cordova platform add android 

错误,

 Creating android project... /home/######/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:126 throw e; ^ Error: An error occurred while listing Android targets at /home/######/.cordova/lib/android/cordova/3.4.0/bin/lib/check_reqs.js:87:29 at _rejected (/home/######/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:808:24) at /home/######/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:834:30 at Promise.when (/home/######/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:1079:31) at Promise.promise.promiseDispatch (/home/######/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:752:41) at /home/######/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:574:44 at flush (/home/######/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:108:17) at process._tickCallback (node.js:415:13) Error: /home/######/.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) 

我找到了同样的问题的解决方案。 我不知道什么是解决方案,但我解决了它:

  1. 我从零开始重新开始。 将我的项目文件夹备份到myproject.bak文件夹中

    启动phonegap创建myproject

  2. cd myproject

  3. cordova platform add android

  4. 我将我的项目资源从myproject.bak复制到我的新项目中

  5. grunt phonegap:build:android

在这个时候,我已经有一个错误,因为在我的projet一个重音文件。 我发现这个错误与以下命令:

 ant debug -f "/home/grattepoil/path/to/my/project/platforms/android/build.xml" -Dout.dir=ant-build -Dgen.absolute.dir=ant-gen -logfile log-ant.txt