XCode升级到9或10后,cordova build时报错:toLowerCase of undefined...
解决方案:
修改platforms/ios/cordova/lib/list-emulator-build-targets文件第53行左右。原来的代码:
if (device.name === deviceType.name.replace(/\-inch/g, ‘ inch‘) &&
device.availability.toLowerCase().indexOf(‘unavailable‘) < 0) {
availAcc.push(device);
}
修改为:
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);
}
}
原文地址:https://www.cnblogs.com/oliverreal/p/9859343.html