如何在cordova中为ubuntu构建应用程序?

时间:2015-05-14 04:57:07

标签: cordova ubuntu

我已经在ubuntu 14.04中成功构建了cordova中的android应用程序。 但是,当我尝试在项目文件夹中运行cordova build ubuntu时,我收到了错误,如下所示:

ERROR building one of the platforms: Error: /home/ninger/cordova/vfinder/platforms/ubuntu/cordova/build: Command failed with exit code 1
You may not have the required environment or OS to build this project
Error: /home/ninger/cordova/vfinder/platforms/ubuntu/cordova/build: Command failed with exit code 1
    at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131: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)

运行cordova -d后运行ubuntu,我得到了如下的详细输出,几乎相同的提示:

missing icon element in config.xml
Generating config.xml from defaults for platform "ubuntu"
Calling plugman.prepare for platform "ubuntu"
Preparing ubuntu project
Processing configuration changes for plugins.
Iterating over installed plugins: [ 'cordova-plugin-whitelist' ]
Writing out cordova_plugins.js...
missing icon element in config.xml
Running command:/home/ninger/cordova/test/platforms/ubuntu/cordova/run 
Building Desktop Application...
Missing icon
Command finished with error code 1:/home/ninger/cordova/test/platforms/ubuntu/cordova/run 
ERROR running one or more of the platforms: Error: /home/ninger/cordova/test/platforms/ubuntu/cordova/run: Command failed with exit code 1
You may not have the required environment or OS to run this project

1 个答案:

答案 0 :(得分:3)

我遇到了同样的问题,并在互联网上找到了不起作用的不同解决方案。我在git仓库https://github.com/apache/cordova-ubuntu做了一些研究。 显然这个bug在夏天已经解决了,但最后一个版本是从去年12月开始的。因此,为了解决这个问题,只需直接从存储库添加平台,就像这样

  

cordova平台添加https://github.com/apache/cordova-ubuntu

希望这可以解决您的问题。