-
Notifications
You must be signed in to change notification settings - Fork 986
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cordova build iOS error: Cannot read property 'toLowerCase' of undefined with Xcode 9.4.1 #427
Comments
I already made a Pull request to fix this: |
@kashban Thanks, why would I use xcode 9.4 reported that such a mistake,for macOS 10.14.1 Beta ? |
There was an update for the xcode build tools not long ago which was also issued for XCode 10 (not beta), breaking the same stuff. Perhaps it's not bound to Xcode 10.1 beta. |
@kashban I merged your PR code, the same error occurs |
@lynzz Then your error stems from another source. I am on vacation right now and will be back at Oct 22th. Please post the complete stack trace of this error into your ticket. |
I'm getting the below stack trace. My list-emulator-build-targets line 54 is: It looks like the device availability property got renamed to isAvailable; here's one of the devices:
... and here's the promised stack trace:
|
That's exactly the issue my PR fixes. |
@kashban Yes, it looks like the same issue. |
@csabbey , yes, i change the "if" line 54 of platforms/ios/cordova/lib/list-emulator-build-targets for: if (device.name === deviceType.name.replace(/\-inch/g, ' inch') && device.isAvailable == 'YES') then, the function "availableDevices" is: var availableDevices = Object.keys(devices).reduce(function (availAcc, deviceCategory) {
var availableDevicesInCategory = devices[deviceCategory];
availableDevicesInCategory.forEach(function (device) {
//console.log(device);
if (device.name === deviceType.name.replace(/\-inch/g, ' inch') && device.isAvailable == 'YES') {
availAcc.push(device);
}
});
return availAcc;
}, []); It works! PD: if, example your run "ionic cordova build ios" and device "iphone" is conected to mac. the change apply (line 54) is delete. then you must apply it again. |
@waflessnet Once my PR is merged and released with the next major version the change will be permanent. It even considers both json formats, so it will be backward compatible. |
in xcode > 10 dont work :( |
I had this same problem, but I found a solution. I don't know if it would work for others but I should probably share it in case. Note: I am using cordova without ionic Cordova: 8.1.2 ([email protected]) |
Shouldn't happen anymore with XCode 10.1. Apple reintroduced the former availability property and added a new boolean one called isAvailable. This accepted merge request takes care of both and will be in the next major release: #451 |
any solution for above issue. |
this started happening on xcode 10.2.1 and i have no solution to get it working again :( |
Create a new issue with all the ncessary information please. Thanks. |
it's happening in Xcode 10.2.1 and i didn't find any solution. |
It just happened to me with Xcode 10.2, running on the MacOS Catalina beta. I fixed it by slightly altering the answer @waflessnet gave. Replace the
|
I don't know why but I had already tried and just worked it after that I reinstall the Xcode, anyway now it's working, thanks a lot @JillevdW and @waflessnet. |
Why is this closed? This still happens with the latest cordova release installed |
Please raise a new issue with the necessary information, as requested by @janpio. We do not actively support discussions in closed issues. It is fine for the new issue to reference this issue number. And please keep in mind that this project is maintained by a bunch of overworked volunteers. |
this solved my problem! |
I have cordova |
I am experiencing the same problem after updating xcode. cordova: 8.0.0 |
Guys please report this kind of thing in a new issue with a reproducible example ([1]) as we do not support discussions in closed issues. [1] https://stackoverflow.com/help/minimal-reproducible-example |
This comment has been minimized.
This comment has been minimized.
No more discussion on this issue please. Please raise a new issue with the reproducible example. At this point the maintainers to not have time to actively support use with Ionic. Please consider using Capacitor for Ionic, since Capacitor was designed to work more smoothly with Ionic. I am now locking this issue as resolved. |
Ionic:
ionic (Ionic CLI) : 4.0.2 (/Users/lzz/.nvm/versions/node/v8.9.1/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.1.8
Cordova:
cordova (Cordova CLI) : 7.1.0
Cordova Platforms : android 6.3.0, ios 4.5.5
System:
Android SDK Tools : 25.2.3
ios-deploy : 1.9.2
ios-sim : 6.1.2
NodeJS : v8.9.1 (/Users/lzz/.nvm/versions/node/v8.9.1/bin/node)
npm : 5.5.1
OS : macOS Mojave 10.14.1 Beta
Xcode : Xcode 9.4 Build version 9F1027a
Environment:
ANDROID_HOME : /Users/lzz/Library/Android/sdk
Reinstall xcode 10, and such a mistake
Why?
The text was updated successfully, but these errors were encountered: