本文介绍了离线构建Cordova应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我正在使用 netbeans cordova 来构建用于移动设备(android/iOS)的html5应用

I am using netbeans with cordova to build html5 apps for mobile (android/iOS)

在未连接到Internet的情况下在 netbeans 中构建应用程序时出现问题,因为 cordova 始终尝试下载插件,尽管我已经连接到互联网,并且它下载了所需的一切,并且该应用程序运行良好.当互联网连接中断时,我无法建立.

I have a problem when building application in netbeans while not connected to the internet because cordova is always trying to download plug-ins although I have been connected to the internet and it downloaded everything needed and the app works great. when internet connection is down I can't build.

您是否有任何想法要从Internet禁用cordova插件下载.我在同一天多次断开了互联网连接,由于我处于离线状态,cordova在编译时给了我错误:

do you have any idea to disable cordova plug-in download from the internet. I loose my internet connection many times at the same day and cordova gives me errors when compiling because I am offline:

ant -f /home/user/NetBeansProjects/electionMobile/nbproject -Dandroid.target.device.arg=emulate -Denv.DISPLAY=:0.0 -Dupdate.task.jar=/home/user/.netbeans/7.4/ant/extra/org-netbeans-modules-cordova-projectupdate.jar -Dandroid.sdk.home=/var/www/adt-bundle-linux-x86_64-20130917/sdk -Dandroid.build.target=android-17 -Dstart.file=index.html -Dandroid.project.activity=electionMobile -Dconfig=android "-Dios.certificate.name=iPhone Developer" -Dsite.root=www "-Dcordova.version=3.1.0-0.1.0
" sim-android
check-android-template:
check-cordova-version:
check-cordova-project:
upgrade-to-cordova-project:
create-android:
update-plugins:
cordova plugins
cordova -d plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-media.git
Calling plugman.fetch on plugin "https://git-wip-us.apache.org/repos/asf/cordova-plugin-media.git"
Fetching plugin from location "https://git-wip-us.apache.org/repos/asf/cordova-plugin-media.git"...
Fetching plugin via git-clone command: git clone "https://git-wip-us.apache.org/repos/asf/cordova-plugin-media.git" "plugman-tmp1386435517527"
Error: Error fetching plugin: Error: failed to get the plugin via git from URL https://git-wip-us.apache.org/repos/asf/cordova-plugin-media.git, output: Cloning into 'plugman-tmp1386435517527'...
error: Couldn't resolve host 'git-wip-us.apache.org' while accessing https://git-wip-us.apache.org/repos/asf/cordova-plugin-media.git/info/refs
fatal: HTTP request failed

    at /usr/lib/node_modules/cordova/src/plugin.js:117:39
    at /usr/lib/node_modules/cordova/node_modules/plugman/src/fetch.js:56:35
    at /usr/lib/node_modules/cordova/node_modules/plugman/src/util/plugins.js:47:38
    at /usr/lib/node_modules/cordova/node_modules/shelljs/shell.js:1707:7
    at ChildProcess.exithandler (child_process.js:641:7)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at maybeClose (child_process.js:735:16)
    at Socket.<anonymous> (child_process.js:948:11)
    at Socket.EventEmitter.emit (events.js:95:17)
    at Pipe.close (net.js:466:12)
/home/user/NetBeansProjects/electionMobile/nbproject/build.xml:227: exec returned: 1
BUILD FAILED (total time: 1 second)

推荐答案

由于互联网不稳定,我发现了其他无需每次下载插件即可构建的地方.

I found a way somewhere else to build without downloading plugins every time as my internet is inconsistent.

如果我更改了插件列表怎么办:

What I do if I changed the plugin list:

  • 在线构建
  • 转到files-nbproject-build.xml-(update-plugins)
  • 使用html注释来注释标签:
    plugintask/>

注意:要真正添加新插件,您需要先取消注释并在线构建,然后再对其进行评论

Note: to actually add new plugins you need to uncomment it and build online before commenting it again

这篇关于离线构建Cordova应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 23:35