New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Cordova is not available" when running in web browser #1289

Closed
klauserber opened this Issue Oct 22, 2017 · 9 comments

Comments

Projects
None yet
8 participants
@klauserber

klauserber commented Oct 22, 2017

Short description of the problem:

Hi, I am here on ionic-cli 3.13.2 and see the following warnings:

...
[14:23:25] console.log: Angular is running in the development mode. Call enableProdMode() to enable the production mode.
[14:23:26] console.warn: Native: tried calling StatusBar.styleDefault, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator
[14:23:26] console.warn: Native: tried calling SplashScreen.hide, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator
[14:23:29] lint finished in 5.73 s

What behavior are you expecting?

no wranings

Steps to reproduce:

  1. ionic start blank
  2. ionic serve -c

Which @ionic/app-scripts version are you using?

3.13.2

@mlynch mlynch closed this Oct 22, 2017

@JosepAlacid

This comment has been minimized.

Show comment
Hide comment
@JosepAlacid

JosepAlacid Nov 12, 2017

On a mac os El Capitan the error is still going when ionic serve -l

JosepAlacid commented Nov 12, 2017

On a mac os El Capitan the error is still going when ionic serve -l

@n0mer

This comment has been minimized.

Show comment
Hide comment
@n0mer

n0mer Jan 4, 2018

@mlynch why this issue is closed?

n0mer commented Jan 4, 2018

@mlynch why this issue is closed?

@kensodemann

This comment has been minimized.

Show comment
Hide comment
@kensodemann

kensodemann Jan 4, 2018

@n0mer - the cordova.js file is only included when you are running natively on a device, not when running in a browser. That is likely why this is closed.

https://stackoverflow.com/questions/43182619/cordova-js-not-available-while-running-in-chrome

kensodemann commented Jan 4, 2018

@n0mer - the cordova.js file is only included when you are running natively on a device, not when running in a browser. That is likely why this is closed.

https://stackoverflow.com/questions/43182619/cordova-js-not-available-while-running-in-chrome

@n0mer

This comment has been minimized.

Show comment
Hide comment
@n0mer

n0mer Jan 4, 2018

ionic cordova run browser will load those native plugins that support browser platform.

n0mer commented Jan 4, 2018

ionic cordova run browser will load those native plugins that support browser platform.

@n0mer

This comment has been minimized.

Show comment
Hide comment
@n0mer

n0mer Jan 4, 2018

anyway, in my case that error was caused by --livereload flag.

When i started w/out -lc (strange, but -c flag triggers -l as well), i got rid of this message, and debug via chrome://inspect#devices

n0mer commented Jan 4, 2018

anyway, in my case that error was caused by --livereload flag.

When i started w/out -lc (strange, but -c flag triggers -l as well), i got rid of this message, and debug via chrome://inspect#devices

@kensodemann

This comment has been minimized.

Show comment
Hide comment
@kensodemann

kensodemann Jan 4, 2018

OK, cool. Note that we generally do not suggest using the Cordova browser platform in general and rather suggest working around the fact that you do not have Cordova plugins in the browser by using native web APIs when Cordova is not present as outlined in the "Plugins" section of this document: https://ionicframework.com/docs/developer-resources/desktop-support/

But if using that platform works for you for testing, have at it.

kensodemann commented Jan 4, 2018

OK, cool. Note that we generally do not suggest using the Cordova browser platform in general and rather suggest working around the fact that you do not have Cordova plugins in the browser by using native web APIs when Cordova is not present as outlined in the "Plugins" section of this document: https://ionicframework.com/docs/developer-resources/desktop-support/

But if using that platform works for you for testing, have at it.

@Bala22333

This comment has been minimized.

Show comment
Hide comment
@Bala22333

Bala22333 Feb 9, 2018

How to fix cordova not available problem in ionic.Suggest me a solution for these...

Bala22333 commented Feb 9, 2018

How to fix cordova not available problem in ionic.Suggest me a solution for these...

@pakogn

This comment has been minimized.

Show comment
Hide comment
@pakogn

pakogn Mar 30, 2018

HI

I just faced this problem when using SQLite but I think is a general error dealing with cordova plugins. I found this and it worked like a charm.

I'm testing on an android device.

https://stackoverflow.com/questions/40815183/ionic-2-cordova-is-not-available-make-sure-to-include-cordova-js-or-run-in-a-d

@Bala22333

pakogn commented Mar 30, 2018

HI

I just faced this problem when using SQLite but I think is a general error dealing with cordova plugins. I found this and it worked like a charm.

I'm testing on an android device.

https://stackoverflow.com/questions/40815183/ionic-2-cordova-is-not-available-make-sure-to-include-cordova-js-or-run-in-a-d

@Bala22333

@elhamzaouiaymen

This comment has been minimized.

Show comment
Hide comment
@elhamzaouiaymen

elhamzaouiaymen Aug 4, 2018

@n0mer you saved my life ;) thanks.

elhamzaouiaymen commented Aug 4, 2018

@n0mer you saved my life ;) thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment