简体   繁体   中英

Ionic cordova build ios - cannot read property 'name' of undefined

Getting below error

cannot read property 'name' of undefined

while building ionic app in mac

modify platform/ios/cordova/lib/list-emulator-build-targets:

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) {
                            availAcc.push(device);
                        }
                    }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM