Skip to content

Cordova not available when using livereload on CLI 3.8.0 #2634

@jayserdny

Description

@jayserdny

After updating to CLI 3.8.0, running in Android device using the command ionic cordova run android -lcs, Cordova plugins does not work. The log shows the following message:

console.warn: Native: tried calling Camera.getPicture, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator

Seems like the issue is when you are trying to run with the livereaload flag. I've tried the following commands:

  • ionic cordova run android --livereload
  • ionic cordova run android -lcs

Only command working is ionic cordova run android.

Plugins tested:

  • Ionic native camera
  • Ionic native geolocation

Steps to reproduce:

  1. Update to CLI 3.8.0
  2. Run your application on Android by using livereload flag
  3. Test Cordova function on device.

Ionic info

@ionic/cli-utils  : 1.8.0
ionic (Ionic CLI) : 3.8.0

global packages:

Cordova CLI : 7.0.1 

local packages:

@ionic/app-scripts : 2.1.3
Cordova Platforms  : android 6.2.3
Ionic Framework    : ionic-angular 3.6.0

System:

Node : v8.2.1
npm  : 5.3.0 
OS   : macOS Sierra

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions