ionic-cli: Cordova not available when using livereload on CLI 3.8.0

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

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 24 (5 by maintainers)

Commits related to this issue

Most upvoted comments

cli packages: (/usr/lib/node_modules)

@ionic/cli-utils  : 1.19.1
ionic (Ionic CLI) : 3.19.1

global packages:

cordova (Cordova CLI) : 8.0.0 

local packages:

@ionic/app-scripts : 3.1.8
Cordova Platforms  : android 7.0.0 browser 5.0.3
Ionic Framework    : ionic-angular 3.9.2

System:

Android SDK Tools : 26.1.1
Node              : v8.9.4
npm               : 5.6.0 
OS                : Linux 4.13

The same problem here with android and ionic cordova run android --device -lcs

Thanks for the thorough bug report, @jayserdny! This one snuck in, unfortunately.

I’ve published 3.8.1 to fix this issue.

I’m getting the same issue with ionic cordova run ios -lcs

cli packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils  : 1.19.0
    ionic (Ionic CLI) : 3.19.0

global packages:

    cordova (Cordova CLI) : 7.1.0 

local packages:

    @ionic/app-scripts : 3.1.4
    Cordova Platforms  : android 6.3.0 ios 4.5.4
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 26.1.1
    ios-deploy        : 1.9.2 
    ios-sim           : 6.1.2 
    Node              : v8.9.1
    npm               : 5.5.1 
    OS                : macOS High Sierra
    Xcode             : Xcode 9.2 Build version 9C40b 

Environment Variables:

    ANDROID_HOME : /Users/ben/Library/Android/sdk

Misc:

    backend : pro

@dwieeb Fast and nice work by the way 😉 Updating and testing now.