Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cordova.js not available while running in chrome

I created an app using ionic-cli and is trying to run the app. I get below warning in chrome (trying to add infinite-schroll to the gallary app)

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

How do I include cordova.js only during chrome testing

like image 483
harishr Avatar asked Apr 03 '17 10:04

harishr


2 Answers

Cordova is only included once your app is built to be run on a device, and so it's not available while testing in a browser. This of course means that plugins relying on Cordova wont work either. That's a limitation of testing in a browser. You can disregard the error.

To test all functionality you should test in an emulator or a real device.

like image 189
Schlaus Avatar answered Sep 21 '22 07:09

Schlaus


use command ionic cordova run browser instead of ionic serve

like image 39
Vikas Bharti Avatar answered Sep 23 '22 07:09

Vikas Bharti