Error: [$injector:unpr] Unknown provider: $cordovaImagePickerProvider


#1

Hello all!

I’m struggling with one ngCordova plugin, ImagePicker.

I have added it properly by CLI. And of course I have ngCordova properly installed too, as I am using other plugins too.
(I added the and ['ngCordova] tag to the angular.module.

I have this console message when running on Device, as ImagePicker does not work on WebBrowser:

284285 error Error: [$injector:unpr] Unknown provider: $cordovaImagePickerProvider <- $cordovaImagePicker <- UserController
http://errors.angularjs.org/1.5.3/$injector/unpr?p0=%24cordovaImagePickerProvider%20<-%20%24cordovaImagePicker%20<-%20UserController
at http://192.168.1.135:8100/lib/ionic/js/ionic.bundle.js:13443:12
at http://192.168.1.135:8100/lib/ionic/js/ionic.bundle.js:17793:19
at Object.getService [as get] (http://192.168.1.135:8100/lib/ionic/js/ionic.bundle.js:17946:39)
at http://192.168.1.135:8100/lib/ionic/js/ionic.bundle.js:17798:45
at getService (http://192.168.1.135:8100/lib/ionic/js/ionic.bundle.js:17946:39)
at injectionArgs (http://192.168.1.135:8100/lib/ionic/js/ionic.bundle.js:17970:58)
at Object.instantiate (http://192.168.1.135:8100/lib/ionic/js/ionic.bundle.js:18012:18)
at $controller (http://192.168.1.135:8100/lib/ionic/js/ionic.bundle.js:23417:28)
at Object.self.appendViewElement (http://192.168.1.135:8100/lib/ionic/js/ionic.bundle.js:59908:24)
at Object.render (http://192.168.1.135:8100/lib/ionic/js/ionic.bundle.js:57901:41)

The plugin worked well in a new project I made to test it, before add it to my real project, where it fails.

I think it can be due to the Angular Library version?

The controller is empty, it just crashes when naming the funcion like follows:

.controller('UserController',
      function($scope, $rootScope, $http, $ionicPlatform, $cordovaImagePicker){ 
   ...
});

Works when I remove $cordovaImagePicker, but as I said, this works fine in a blank project where I just tested this only plug.

Any clues?? :confused: Thanks!


#2

Updated cordova, and bower.

Uninstalled the plugin and reinstalled the plugin.

Any of these made the trick. Thanks.