Cordova_not_available when running on android device

[20:22:16]  console.warn: Native: tried calling HTTP.get, but Cordova is not available. Make sure to include cordova.js
            or run in a device/simulator
[20:22:16]  console.error: erreur : cordova_not_available
[20:22:18]  console.error: Error loading deploy information. No Plugin Available

I am getting this error when I run

ionic cordova run android -c -l

It happens only with the -l or -c options.
Here is the list of cordova plugins in package.json:

"cordova": {
    "plugins": {
      "cordova-plugin-advanced-http": {},
      "cordova-plugin-whitelist": {},
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-ionic-webview": {},
      "cordova-plugin-ionic-keyboard": {},
      "cordova-plugin-ionic": {}
    }

This happens when you use with console option (-c). You need remove this option and use debug methods to validate your code.

This happens also with -l option. Does this mean that I can’t use the livereload?

Use the Ionic Pro service to track errors or live view. You can do that in free version.

I also had an issue using Ionic Pro: https://stackoverflow.com/questions/49498154/ionic-view-http-get-works-on-ios-but-not-on-android?noredirect=1#comment86007991_49498154.

@kamal95, if that error is the only information you have, my sugestion is you talk to support of your Pro account about this error. I say this because the error dont tell us anything.

Still @kamal95 is right, we can’t seem to use cordova with the live reload flag. And tracking errors or live view are not the same thing. Or did I misunderstand something?

Yes @gilcatre, you understood well.

Any progress on this?

I am seeing the same issue. I am using ionic native storage and I deploy to my android device via ionic cordova run android -l and get the cordova_not_available error.

Not sure how to debug on my android device without the livereload support.

1 Like