简体   繁体   中英

Cordova-plugin-camera is not being loaded; failed version requirement for cordova-android version: >5.0.0-dev

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!

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM