1

I'm using Netbeans 8 to build Cordova app (and am new to it) using the standard method of selecting the standard plugins to use through the Netbeans cordova config. When I build on Netbeans, the build is successful but the camera plugin is removed. The build output says:

Installing "cordova-plugin-camera" for android
Running command: cmd "/s /c "C:\test\platforms\android\cordova\version.bat""
Command finished with error code 0: cmd /s /c "C:\test\platforms\android\cordova\version.bat"
Plugin doesn't support this project's cordova-android version. cordova-android: 4.1.1, failed version requirement: >=5.0.0-dev

My Cordova version is 5.3.3 and my cordova-android platform is 4.1.1. There is no 5.0.0-dev Cordova android platform so I am confused!

When I look on the github repository from which netbeans is pulling, the plugin.xml does have this listed:

  <engine name="cordova-android" version=">=5.0.0-dev" />

Would this be the problem, and is that an issue with the repository? I would try to avoid the repository and store locally and change that line to 4.1.1 and give it a try, but I can't figure out how to bypass the get from the repository (im totally new at this)

any help appreciated!

David Brossard
  • 13,584
  • 6
  • 55
  • 88
flintster
  • 11
  • 1
  • 2

1 Answers1

1

It looks like you are using the 'master' branch of the camera plugin from here: https://github.com/apache/cordova-plugin-camera

As we prepare for cordova-android 5.0's release we are making changes to plugins to support it: https://github.com/apache/cordova-plugin-camera/commit/2714060b09c4d2765cf924d22f80a74d2502530f

Using the github master branch is not recommended way to consume plugins as it is prone to stability issues like this.

The guidance is to use npm where cordova-plugin-camera is published. For example, using the cordova CLI you can type:

cordova plugin add cordova-plugin-camera

-Nikhil

nikhilkh
  • 11
  • 1
  • Thank you! I had a hard time figuring out how to accommodate this in netbeans (it automatically reverts to master branch) but think I have an appoach for those who it may help: 1) install plugin as Nikhil suggests, 2) add the plugin in the Netbeans config UI and DO NOT BUILD, 3) edit the nbproject/plugins.properties to read 'org.apache.cordova.camera=cordova-plugin-camera' (to fetch locally) and DO NOT EVER remove the plugin from the netbeans config UI. Only issue is it only works on every 2nd build... the plugin is still removed on every other build (but restores locally) This is using NB8. – flintster Oct 24 '15 at 13:43
  • I found another solution to the Netbeans workflow issue. 1) Do not use the Netbeans plugin config UI at all. 2) Install plugins via 'cordova plugin add cordova-plugin-camera' etc run from your project directory and 3) comment out the 'plugintask' in build.xml: . [This question](http://stackoverflow.com/questions/23850330/why-does-netbeans-8-want-to-install-unused-cordova-plugins) was helpful in this. – flintster Oct 24 '15 at 14:52
  • But using npm is producing same errors for me... sudo phonegap plugin add org.apache.cordova.camera Password: Notice: org.apache.cordova.camera has been automatically converted to cordova-plugin-camera and fetched from npm. This is due to our old plugins registry shutting down. Fetching plugin "cordova-plugin-camera" via npm Installing "cordova-plugin-camera" for android Plugin doesn't support this project's cordova-android version. cordova-android: 4.1.1, failed version requirement: >=5.0.0-dev Skipping 'cordova-plugin-camera' for android – miwoe Nov 25 '15 at 11:05