Reputation: 51
I use ionic3 and [email protected]. Recently my Xcode update to 11.1 and error occured [Cannot read property 'toLowerCase' of undefined].I tried this way: change:
if (device.name === deviceType.name.replace(/\-inch/g, ' inch') &&
device.availability.toLowerCase().indexOf('unavailable') < 0) {
availAcc.push(device);
}
to:
if (device.name === deviceType.name.replace(/\-inch/g, ' inch')) {
if ((device.availability && device.availability.toLowerCase().indexOf('unavailable') < 0)
|| device.isAvailable == 'YES') {
// XCode 10 and lower
availAcc.push(device);
}
}
Then error occurred in
Cannot read property 'name' of undefined
I cannot find where is this 'name'.
Upvotes: 5
Views: 6622
Reputation: 1
Steps to solve this error:
ionic cordova build ios
Upvotes: 0
Reputation: 328
My cordova version is 8.1.2. I encountered the same problem recently on ios.Please check your Android or Ios version and make it to latest if you're using older version of it. You don't need to add/modify any code to list-emulator-build file(cordova/lib/list-emulator-build). It'll be certainly working. latest version of ios is ios(5.0.1).
Upvotes: 0
Reputation: 4448
Remove platform ios and again add platform ios.
It's working for myself.
cordova platform rm ios
cordova platform add ios
Upvotes: 11