Plugin not installed but installed and device isn't ready


I’m working an Ionic Cordova platform project for Windows 10 device, and when I test it on tablet device and trying to use the camera with app, I get:
Ionic Native: tried calling Camera.getPicture, but the Camera plugin is not installed.
If I check the installed plugins, it is installed.
The camera is only an example for this- many plugins that I use seems to be that way.
I searched for many solution in the forums, but none of them helped my to progress:

  1. The order of the src in index.html is correct.
  2. I tried to uninstall all plugins and Ionic native components and re-install them- but the problem stayed.
  3. If I encapsulate the use of plugin with deviceready, it will never happen since the device isn’t ready at all.
    I don’t know if is about versions, so I write my cordova plugin ls:
cordova-plugin-advanced-http 1.11.1 "Advanced HTTP plugin"
cordova-plugin-camera 4.0.3 "Camera"
cordova-plugin-file 6.0.1 "File"
cordova-plugin-geolocation 4.0.1 "Geolocation"
cordova-plugin-inappbrowser 3.0.0 "InAppBrowser"
cordova-plugin-media-capture 3.0.2 "Capture"
cordova-plugin-network-information 2.0.1 "Network Information"
cordova-plugin-screen-orientation 3.0.1 "Screen Orientation"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-whitelist 1.3.3 "Whitelist"
es6-promise-plugin 4.2.2 "Promise"
ionic-plugin-keyboard 2.2.1 "Keyboard"
phonegap-plugin-barcodescanner 8.0.0 "BarcodeScanner"

It may be related, but this is my ionic info results:

   ionic (Ionic CLI)  : 4.1.1 (C:\Users\zk2xra\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.0


   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : windows 5.0.0
   Cordova Plugins       : no whitelisted plugins (12 plugins total)


   NodeJS : v8.11.3 (C:\Program Files\nodejs\node.exe)
   npm    : 6.4.1
   OS     : Windows 10


Your Cordova tooling seems to be out of date, which might be causing all kinds of problems.
You can read about how to figure out the current Cordova versions and how to update CLI, platforms and plugins here:

How are you building and deploying your app?

ionic build
ionic cordova platforms add windows

and then I open the project in VS and use the Store wizard.

ionic cordova build windows would be the correct command and should work out of the box.

Thanks! That solved the issue.

1 Like