Cannot install cordova camera plugin using Ionic 2 framework

Viewed 8585

I am trying to install cordova plugin for camera to use in Ionic 2 application, but I am keep getting error:

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.

I tried removing cordova plugin compat and reinstalling it since I found many answers about this error on stackoverflow, but none of them worked for me. I also tried it with --force flag, but no success.

Also I tried: cordova plugin remove cordova-plugin-compat --force But I get an error:

Error: Cannot find plugin.xml for plugin "cordova-plugin-camera". Please try adding it again.

I really hope anyone can help me since I am stuck here... Thank you in beforehand.

8 Answers

Hi If you want to add cordova plugin into ionic v1 projecct you can do this steps

  1. Remove android
    cordova platform remove android

  2. Add Android
    cordova platform add android@5.0.0

  3. Remove Cordova Compat plugin
    cordova plugin remove --force cordova-plugin-compat

  4. Add Cordova compat plugin
    cordova plugin add cordova-plugin-compat

  5. Add Cordova camera plugin
    cordova plugin add cordova-plugin-camera
    or
    cordova plugin add https://github.com/apache/cordova-plugin-camera.git

I succesfully install camera plugin in ionic v1 project.

Related