Ionic-native: Ionic4 camera native plugin v5.0.0-beta.21 not working in Ionic DevApp

Created on 27 Sep 2018  路  11Comments  路  Source: ionic-team/ionic-native

I'm submitting a ... (check one with "x")
[x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or https://ionicworldwide.herokuapp.com/

Current behavior:
Opening the camera from the ionicDevApp, it gives a "cordova_not_available" message.

Expected behavior:
The camera should open in the ionic dev app too! (as far as I recall it used to work in ionic v3)

Steps to reproduce:

  1. Start with an ionic 4 blank app
  2. add the @ionic-native/camera plugin v5.0.0-beta.21
  3. import it in the app (following the ngx folder) and call the getPicture() method
  4. run ionic serve -c
  5. open the ionicdevapp and see how cordova_not_available appears

Related code:

  scanBook() {
    this.camera.getPicture(this.options).then(
      imageData => {
        // imageData is either a base64 encoded string or a file URI
        // If it's base64 (DATA_URL):
        const base64Image = 'data:image/jpeg;base64,' + imageData;
      },
      async err => {
        const alert = await this.alertController.create({
          header: "Errore",
          message:
            "C'猫 stato un errore, non 猫 possibile scattare fotografie!"+err,
          buttons: [
            {
              text: 'Cancel',
              role: 'cancel',
              cssClass: 'danger'
            }
          ]
        });
        await alert.present();
      }
    );
  }

Ionic info::

Ionic:

   ionic (Ionic CLI)          : 4.1.2 (C:\Users\Giacomo\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework            : @ionic/angular 4.0.0-beta.7
   @angular-devkit/core       : 0.7.5
   @angular-devkit/schematics : 0.7.5
   @angular/cli               : 6.1.5
   @ionic/ng-toolkit          : 1.0.8
   @ionic/schematics-angular  : 1.0.6

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : android 7.1.1, ios 4.5.5
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.2, cordova-plugin-ionic-webview 2.1.4, (and 8 other plugins)

System:

   Android SDK Tools : 26.1.1 (C:\Users\Giacomo\AppData\Local\Android\sdk)
   NodeJS            : v9.2.1 (C:\Program Files\nodejs\node.exe)
   npm               : 6.4.1
   OS                : Windows 10

Is possible that the ionic dev app still need to be updated with the new plugins?

bug

Most helpful comment

+1 to me too not being able to use the Camera plugin through Ionic DevApp with v4.

Following the Ionic Tutorial for v4 located at: https://beta.ionicframework.com/docs/developer-resources/guides/first-app-v4/ios-android-camera

And I'm getting stuck due to the cordova_not_available error.

All 11 comments

+1

+1

I just downgraded to 5.0.0-beta.20 and it is working again, so the problem is situated in the latest update.

@PhilippeSchraepen not to me. I just downgraded both ionic-native/core and ionic-native/camera to beta 20 and it doesn't work on the devapp. Should I do something else other than installing them with npm?

@PhilippeSchraepen not to me. I just downgraded both ionic-native/core and ionic-native/camera to beta 20 and it doesn't work on the devapp. Should I do something else other than installing them with npm?

I reinstalled the modules with npm, and removed and re-added ionic plugins with ionic repair, I think

+1 not working for me with "@ionic-native/camera": "^5.0.0-beta.22", getting cordova_not_available

Strange though, my ionic info seems to have a Cordova Plugins section that sounds like its being blocked:

Ionic:

   ionic (Ionic CLI)             : 4.6.0 (C:\Users\rtpha\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework               : @ionic/angular 4.0.0-rc.0
   @angular-devkit/build-angular : 0.11.4
   @angular-devkit/schematics    : 7.1.4
   @angular/cli                  : 7.1.4
   @ionic/angular-toolkit        : 1.2.2

Cordova:

   cordova (Cordova CLI) : 8.1.2 ([email protected])
   Cordova Platforms     : none
   Cordova Plugins       : no whitelisted plugins (1 plugins total)

System:

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

Running the app in Devapp: I cannot see the console logs on the terminal.
Where do you see the log 'cordova_not_available'

I changed it from console.log to window.alert so that I could see what the error being returned was.

+1 to me too not being able to use the Camera plugin through Ionic DevApp with v4.

Following the Ionic Tutorial for v4 located at: https://beta.ionicframework.com/docs/developer-resources/guides/first-app-v4/ios-android-camera

And I'm getting stuck due to the cordova_not_available error.

fyi I have since tried to use the Admob-Free and Admob-Plus packages with an Ionic v4 app and DevApp and they always return cordova_not_available error as well.

I'm also getting error cordova_not_available .

Yeah this issue is on the wrong repo it seems, as it looks like its an issue with DevApp. The author of the getting started guide on the official docs has acknowledged that the workaround at the moment is to install the app itself onto your device.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ihadeed picture ihadeed  路  4Comments

rajanshahsa picture rajanshahsa  路  3Comments

danbucholtz picture danbucholtz  路  3Comments

shaliko picture shaliko  路  3Comments

sabariferin picture sabariferin  路  4Comments