简体   繁体   English

TypeError:无法读取未定义离子的属性“名称”

[英]TypeError: Cannot read property 'name' of undefined ionic

I am making a project in Ionic.我正在用 Ionic 做一个项目。

When I tried ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0" an error occurred当我尝试ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0"发生错误

TypeError: Cannot read property 'name' of undefined TypeError:无法读取未定义的属性“名称”

To know the deeper cause --verbose when using使用时要知道更深层次的原因--verbose

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

I was able to identify this as the source of the error but I don't know this error solution.我能够将此识别为错误的根源,但我不知道此错误解决方案。

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;
    }
});

this error course MacOS Catalina这个错误课程 MacOS Catalina

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

fix code platform/ios/cordova/liblist-emulator-build-targets修复代码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;
}, []);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 离子cordova构建ios - 无法读取未定义的属性“名称” - Ionic cordova build ios - cannot read property 'name' of undefined (Ionic 2)尝试回退到Cordova-lib执行时发生错误:TypeError:无法读取未定义的属性'then' - (Ionic 2) An Error occurred trying to fall back to Cordova-lib execution: TypeError: Cannot read property 'then' of undefined 类型错误:无法读取未定义的属性“init” - TypeError: Cannot read property 'init' of undefined TypeError:无法在React Native中读取未定义的属性'receiptnumber' - TypeError: Cannot read property 'receiptnumber' of undefined in react native iOs 构建失败 - UnhandledPromiseRejectionWarning:TypeError:无法读取未定义的属性“toLowerCase” - iOs build failing - UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'toLowerCase' of undefined 无法读取未定义的属性“installCoreFunctions” - Cannot read property 'installCoreFunctions' of undefined 无法读取未定义的属性“ messageHandlers” - Cannot read property 'messageHandlers' of undefined Ionic平台命令因“无法读取未定义的属性”拆分”而失败 - Ionic Platform Commands Fail With 'Cannot read property 'split' of undefined' Out of nowhere TypeError:无法读取未定义的属性“ DETECTION_MODE”-“ react-native-awesome-card-io” - TypeError: Cannot read property 'DETECTION_MODE' of undefined - 'react-native-awesome-card-io' TypeError:无法解构“未定义”或“空”的属性“stat” - TypeError: Cannot destructure property `stat` of 'undefined' or 'null'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM