no, it’s not really missing, but if I start the project with
ionic cordova run --device android --livereload
Without live reloading, the app seems to find the cordova.js file. I can see it at the missing console error logs, when I connect to the device in Google Chrome with
chrome://inspect
Soo … Where’s Cordova … or better: Why is it missing at live reload on device, but not on normal build/run without live reload?
Even none of the native plugins are processing at live reloading on a real device or emulator (when Cordova is missing) … naaagh
Experiencing precisely the same problem. Testing the ionic-native geolocation plugin on Android with livereload results fails on device, works on browser.
And it doesn’t matter, if it’s the contacts plugin. It can be any native plugin. The problem is that cordova.js is missing, no matter if it’s running on device or emulator.
Native: tried accessing the Contacts plugin but Cordova is not available. Make sure to include cordova.js or run in a device/simulator
(anonymous) @ ion-dev.js:156
ion-dev.js:156 ERROR Error: Uncaught (in promise): cordova_not_available
at c (polyfills.js:3)
at c (polyfills.js:3)
at polyfills.js:3
at t.invokeTask (polyfills.js:3)
at Object.onInvokeTask (vendor.js:4973)
at t.invokeTask (polyfills.js:3)
at r.runTask (polyfills.js:3)
at o (polyfills.js:3)
at e.invokeTask [as invoke] (polyfills.js:3)
at p (polyfills.js:2)
This error does NOT appear, when I do NOT use the livereload option, because THEN the cordova.js exists and is not missing.
Or is it an ionic (angular?) default behaviour to not use cordova.js at any livereload stages?
Hello! Before days ago i had this problem and, most solutions not works for me. After tests and searchs, i finded another solution and this works for me!
Edit file node_modules/@ionic/app-scripts/dist/dev-server/serve-config.js and change last line to: