gpt4 book ai didi

ios - 类型错误 : Cannot read property 'name' of undefined ionic

转载 作者:行者123 更新时间:2023-11-29 05:21:34 26 4
gpt4 key购买 nike

我正在 Ionic 中制作一个项目。

当我尝试 ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0" 时发生错误

TypeError: Cannot read property 'name' of undefined

了解更深层次的原因:--verbose<使用时

 at /Users/myname/ionic/platforms/ios/cordova/lib/build.js:130:60

我能够识别出这是错误的根源,但我不知道这个错误的解决方案。

var promise = require('./list-emulator-build-targets').targetForSimIdentifier(newTarget);
return promise.then(function (theTarget) {
if (!theTarget) {
return getDefaultSimulatorTarget().then(function (defaultTarget) {
emulatorTarget = defaultTarget.name;
events.emit('log', 'Building for ' + emulatorTarget + ' Simulator');
return emulatorTarget;
});
} else {
emulatorTarget = theTarget.name;
events.emit('log', 'Building for ' + emulatorTarget + ' Simulator');
return emulatorTarget;
}
});

最佳答案

这个错误当然是MacOS Catalina

https://github.com/apache/cordova-ios/issues/427#issuecomment-503522317

修复代码platform/ios/cordova/liblist-emulator-build-targets

var availableDevices = Object.keys(devices).reduce(function (availAcc, deviceCategory) {
var availableDevicesInCategory = devices[deviceCategory];
availableDevicesInCategory.forEach(function (device) {
if (device && device.name === deviceType.name.replace(/\-inch/g, ' inch') && device.isAvailable == true) {
availAcc.push(device);
}
});
return availAcc;
}, []);

关于ios - 类型错误 : Cannot read property 'name' of undefined ionic,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58638785/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com