Unknown provider: $cordovaCameraProvider


#1

It looks like there is something wrong with the cordova-plugin-camera.

After adding the plugin via:

ionic plugin add cordova-plugin-camera

and adding the $cordovaCamera dependency to my controller:

.controller('CameraCtrl', function($scope, $cordovaCamera){
...
}

I get the following error:

0     977452   error    Error: [$injector:unpr] Unknown provider: $cordovaCameraProvider <- $cordovaCamera <- CameraCtrl

I’ve noticed that the camera obj is added to the global navigator so I guess the plugin is really installed but I dont know what’s going on.

Same result under ionic 1.2.4, ionic 1.1.1 (though it seems is something related to the plugin itself and not ionic).

Any help?


#2

i’m also seeing the same issue.


#3

you can try cordova capture as alternative/workaround


#4

I’m having the same issue and none of these replies are being helpful


#5

because cordova-plugin-camera is a part of ngCordova, then have to install ngCordova firstly and add it to dependency injection: http://ngcordova.com/docs/install/

Then your code will run.