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

社会主义新天地 提交于 2019-12-24 16:35:24

问题


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!


回答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



来源:https://stackoverflow.com/questions/33313112/cordova-plugin-camera-is-not-being-loaded-failed-version-requirement-for-cordov

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!