Unable to add native camera plugin in ionic project


#1

Hello,

I am trying to add camera plugin and get this error
Installing “cordova-plugin-camera” for android
Failed to install ‘cordova-plugin-camera’: CordovaError: Version of installed plugin:
“cordova-plugin-compat@1.0.0” does not satisfy dependency plugin requirement “cordova-plugin-compat@^1.1.0”. Try
–force to use installed plugin as dependency.
at C:\Users\XY\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\install.js:581:33
at _fulfilled (C:\Users\XY\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:787:54)
at self.promiseDispatch.done (C:\Users\XY\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:816:30)
at Promise.promise.promiseDispatch
(C:\Users\XY\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:749:13)
at C:\Users\XY\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:509:49
at flush (C:\Users\XY\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:108:17)
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickCallback (internal/process/next_tick.js:104:9)
Error: Version of installed plugin: “cordova-plugin-compat@1.0.0” does not satisfy dependency plugin requirement
"cordova-plugin-compat@^1.1.0". Try --force to use installed plugin as dependency.

It looks like the plugin version does not support the version of ionics? How fix this?

Thanks.


#2

this works for me
cordova plugin remove cordova-plugin-compat --force
cordova plugin add cordova-plugin-compat


#3

Ionic doesn’t require cordova-plugin-compat by itself - you probably have another Cordova plugin already installed that uses it in version 1.0.0 and now the new plugin wants a newer version 1.1.0.