Ionic build - cordova_not_available on device

Hello Ionites,
anyone else got problems with last release of Ionic CLI?
When i run on devices (iOS/android) i get cordova_not_available on (@angular/common/http) http requests and (@ionic/angular) QR reader plugin calls.
What’s wrong?

sudo npm install -g ionic@latest
/Users/voidbrain/.npm-global/bin/ionic -> /Users/voidbrain/.npm-global/lib/node_modules/ionic/bin/ionic
+ ionic@4.12.0
updated 1 package in 14.231s

But ionic info returns 4.9:

Ionic:

   ionic (Ionic CLI)             : 4.9.0 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.1.1
   @angular-devkit/build-angular : 0.13.6
   @angular-devkit/schematics    : 7.2.4
   @angular/cli                  : 7.3.6
   @ionic/angular-toolkit        : 1.4.0

Cordova:

   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : android 7.1.4, ios 4.5.5
   Cordova Plugins       : 
cordova-plugin-add-swift-support 1.7.2 "AddSwiftSupport"
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-ionic-keyboard 2.1.3 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 3.1.2 "cordova-plugin-ionic-webview"
cordova-plugin-network-information 2.0.1 "Network Information"
cordova-plugin-qrscanner 2.6.0 "QRScanner"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-whitelist 1.3.3 "Whitelist"

System:

   NodeJS : v11.8.0 (/usr/local/bin/node)
   npm    : 6.5.0
   OS     : macOS Mojave
   Xcode  : Xcode 10.1 Build version 10B61

Ok… i really need to understand global vs local difference, updated Ionic to 4.12 but cordova_not_available is still there.

Are you running it on an actual device/emulator? You get that error if running on the browser using ionic serve.

real device.
I just was typing ionic build,
when tried ionic Cordova build ios I got

`CordovaError: Promise rejected with non-error: “ios-deploy was not found. Please download, build and install version 1.9.2 or greater from https://github.com/phonegap/ios-deploy into your path, or do ‘npm install -g ios-deploy’”
at cli.catch.err (/usr/local/lib/node_modules/cordova/bin/cordova:30:15)
at processTicksAndRejections (internal/process/next_tick.js:81:5)
[ERROR] An error occurred while running subprocess cordova.

   cordova build ios exited with exit code 1.`

on second computer ionic Cordova build ios is fine and solved the problem.

:fearful: just relaunched on second computer and now I get

CordovaError: Promise rejected with non-error: 'ios-deploy was not found. Please download, build and install version 1.9.2 or greater from https://github.com/phonegap/ios-deploy into your path, or do \'npm install -g ios-deploy\''
    at cli.catch.err (/usr/local/lib/node_modules/cordova/bin/cordova:30:15)
    at process._tickCallback (internal/process/next_tick.js:68:7)
[ERROR] An error occurred while running subprocess cordova.
        
        cordova build ios exited with exit code 1.

also here. What’s going?

That’s npm package you’re missing. Just npm install ios-deploy.

But this shouldn’t be giving you building errors (still install that package and run again just in case).

Try to run ionic Cordova build ios --verbose and see what info you get and post it here if you can’t fix your issue.

UseModernBuildSystem=0 flag
Now I feel so stupid :slight_smile: Thanks

1 Like