El Dude
El Dude

Reputation: 5618

Ionic Cordova build fails with 'toLowerCase' of undefined

My Ionic app build on OSX suddenly started failing with the below error. I have not done anything, other letting go through a Xcode update. No code change on my end. I reverted to a previous production build and tried to rebuild from there but same error.

No change in the code indicates that the build process is broken

  1. Should I revert to the previous Xcode version (but how?).
  2. Should I update Ionic / Cordova? Will do that most likely.
  3. Should I just check out my project again and rebuild from a clean folder?

I see from other posts that might be a promise issue where it's trying to resolve a promise from a buggy object.

Cannot read property 'toLowerCase' of undefined
TypeError: Cannot read property 'toLowerCase' of undefined
    at /Users/me/app/platforms/ios/cordova/lib/list-emulator-build-targets:54:45
    at Array.forEach (<anonymous>)
    at /Users/me/app/platforms/ios/cordova/lib/list-emulator-build-targets:52:44
    at Array.reduce (<anonymous>)
    at /Users/me/app/platforms/ios/cordova/lib/list-emulator-build-targets:50:57
    at Array.reduce (<anonymous>)
    at /Users/me/app/platforms/ios/cordova/lib/list-emulator-build-targets:45:28
    at _fulfilled (/Users/me/app/platforms/ios/cordova/node_modules/q/q.js:854:54)
    at /Users/me/app/platforms/ios/cordova/node_modules/q/q.js:883:30
    at Promise.promise.promiseDispatch (/Users/me/app/platforms/ios/cordova/node_modules/q/q.js:816:13)
ionic --version
4.10.3

"cordova-android": "7.1.4",
"cordova-ios": "4.5.5",

Xcode v 11.1

Upvotes: 0

Views: 514

Answers (1)

Dhruv Singh
Dhruv Singh

Reputation: 2243

Apparently xcode 11 has some conflict with a validation in the file list-emulator-build-targets. You need to execute this command.

ionic cordova platform rm ios
ionic cordova platform add ios@latest

Make sure that you get the cordova-ios version >= 5.0.0

Upvotes: 1

Related Questions