Ionic native : ImageResizer installation issues

I want to use https://ionicframework.com/docs/native/image-resizer/ in my project

I did:

ionic cordova plugin add info.protonet.imageresizer
npm install --save @ionic-native/image-resizer

on cordova run android I got:

ionic\platforms\android\src\info\protonet\imageresizer\ImageResizer.java:15:
error: package org.apache.cordova.camera does not exist

So I did:

ionic cordova plugin add cordova-plugin-camera

Then I got:

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

So I did:

ionic cordova plugin add cordova-plugin-camera --force

finally on cordova run android I got:

ionic\platforms\android\src\org\apache\cordova\camera\CameraLauncher.java:32:
error: cannot find symbol import org.apache.cordova.BuildHelper;

BuildHelper comes from cordova-plugin-compat
So maybe the --force option wasn’t a good, idea. Someone has some clues to help me?

This solves my issue:

ionic cordova plugin remove --force cordova-plugin-camera
ionic cordova plugin remove --force cordova-plugin-compat
ionic cordova plugin add cordova-plugin-compat@1.1.0

ionic cordova platform remove android
ionic cordova platform add android

ionic cordova plugin add cordova-plugin-camera

source:

1 Like