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:
- Update to CLI 3.8.0
- Run your application on Android by using livereload flag
- 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
- fix(cordova): fix cordova serve issue with cordova.js mock fixes https://github.com/ionic-team/ionic-cli/issues/2634 — committed to ionic-team/ionic-cli by imhoffd 7 years ago
cli packages: (/usr/lib/node_modules)
global packages:
local packages:
System:
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
@dwieeb Fast and nice work by the way 😉 Updating and testing now.