7

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

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.

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)
2
  • Could you elaborate how did you create the project and add the plugins into it?
    – VicM
    Commented Dec 8, 2013 at 6:40
  • I am using ubuntu 12.04 LTS 64bit and netbeans 7.4. I don't use external plugins. There are plugins under netbeans cordova configuration (camera, gps,...). I am working on the sample cordova map application from netbeans wizard! And I didn't yet added any specific code. using android sdk version 4.2.2 with api installed
    – kamil
    Commented Dec 9, 2013 at 10:31

6 Answers 6

4

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:

  • Build online
  • Go to files-nbproject-build.xml-(update-plugins)
  • Use html comment to comment out the tag:
    plugintask/>

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

1
  • you are awesome, but netbeans removes some plugins and add others randomly, it seems a netbeans bug
    – kamil
    Commented Jul 3, 2015 at 7:22
2

Replace org.apache.cordova.device=https://github.com/apache/cordova-plugin-device for org.apache.cordova.device=https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git in nbprojects/plugin.properties

1

I installed Cordova on my school PC, where the Internet is very irregular, and yet it compiles when offline.

Are you using some external plugin with it? Or are you missing something in your Android SDK tool?

I have the entire Android SDK toolkit installed on it, and it doesn't whimper even if it goes offline.

1
  • netbeans removes plugins on build
    – kamil
    Commented Jul 3, 2015 at 7:23
1

I had the same problem. After exchanging in nbprojects/plugin.properties the line

org.apache.cordova.AudioHandler=https://git-wip-us.apache.org/repos/asf/cordova-plugin-media.git

with

org.apache.cordova.media=https://git-wip-us.apache.org/repos/asf/cordova-plugin-media.git

the problem disappeared.

1
  • To be more precise: you change that line, then compile it once with internet connection available. After that you can continue to work offline.
    – Huebi
    Commented Dec 26, 2013 at 19:22
1

I know it's not the pest answer but it helped me,

  • Compile and run the project.
  • Go to /nbproject/plugins.properties file.
  • Put # before every plugin, That mean's you disabled all plugins but all your plugins stayed in the plugins folder even if you want to clean and build the project it will work.

EDIT: simple way

  • Compile and deploy the project
  • Go to project properties goto cordova tab and click on plugins panel then remove all plugins.
1
  • netbeans removes plugins after commenting
    – kamil
    Commented Jul 3, 2015 at 7:24
0

I know this problem; try opening a command line and typing:

:>git config --global http.sslVerify false
1
  • You know the problem? Great! What is the problem? You provide a solution but don't say what it is that it solves. Please expand your answer.
    – David
    Commented May 24, 2015 at 15:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.