Comments (27)
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 availableDevices
function in platforms/ios/cordova/lib/list-emulator-build-targets
with the following:
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;
}, []);
from cordova-ios.
Why is this closed? This still happens with the latest cordova release installed
from cordova-ios.
@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.
from cordova-ios.
I have cordova 9.0.0 ([email protected])
and xCode Version 11.0 (11A420a)
. Still facing this issue
from cordova-ios.
Create a new issue with all the ncessary information please. Thanks.
from cordova-ios.
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.
from cordova-ios.
I already made a Pull request to fix this:
from cordova-ios.
@kashban Thanks, why would I use xcode 9.4 reported that such a mistake,for macOS 10.14.1 Beta ?
from cordova-ios.
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.
from cordova-ios.
@kashban I merged your PR code, the same error occurs
from cordova-ios.
@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.
from cordova-ios.
I'm getting the below stack trace. My list-emulator-build-targets line 54 is:
device.availability.toLowerCase().indexOf('unavailable') < 0
It looks like the device availability property got renamed to isAvailable; here's one of the devices:
{ state: 'Shutdown',
isAvailable: 'YES',
name: 'iPad Pro (12.9-inch)',
udid: '5A707375-7596-4375-9A7A-75690B681B46',
availabilityError: '' }
... and here's the promised stack trace:
TypeError: Cannot read property 'toLowerCase' of undefined
at /Users/me/code/ms-client-echidna/platforms/ios/cordova/lib/list-emulator-build-targets:54:45
at Array.forEach (<anonymous>)
at /Users/me/code/ms-client-echidna/platforms/ios/cordova/lib/list-emulator-build-targets:52:44
at Array.reduce (<anonymous>)
at /Users/me/code/ms-client-echidna/platforms/ios/cordova/lib/list-emulator-build-targets:50:57
at Array.reduce (<anonymous>)
at /Users/me/code/ms-client-echidna/platforms/ios/cordova/lib/list-emulator-build-targets:45:28
at _fulfilled (/Users/me/code/ms-client-echidna/platforms/ios/cordova/node_modules/q/q.js:854:54)
at /Users/me/code/ms-client-echidna/platforms/ios/cordova/node_modules/q/q.js:883:30
at Promise.promise.promiseDispatch (/Users/me/code/ms-client-echidna/platforms/ios/cordova/node_modules/q/q.js:816:13)
from cordova-ios.
That's exactly the issue my PR fixes.
from cordova-ios.
@kashban Yes, it looks like the same issue.
from cordova-ios.
@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.
from cordova-ios.
in xcode > 10 dont work :(
from cordova-ios.
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.
I uninstalled then reinstalled ios platform.
I ran npm update.
Note: I am using cordova without ionic
Cordova: 8.1.2 ([email protected])
ios-deploy: 1.9.2
xcode: 9.4.1
from cordova-ios.
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
from cordova-ios.
K-MacBook-Pro:projectname2.1.7(2.1.7.3) K$ cordova build ios
Cannot read property 'toLowerCase' of undefined
any solution for above issue.
from cordova-ios.
this started happening on xcode 10.2.1 and i have no solution to get it working again :(
from cordova-ios.
it's happening in Xcode 10.2.1 and i didn't find any solution.
from cordova-ios.
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.
from cordova-ios.
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
availableDevices
function inplatforms/ios/cordova/lib/list-emulator-build-targets
with the following: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; }, []);
this solved my problem!
Thanks!!
from cordova-ios.
I am experiencing the same problem after updating xcode.
My current project has the following versions:
cordova: 8.0.0
ios platform: ^ 4.5.5
xcode: 11.0
ios version: Mojave 10.14
from cordova-ios.
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
from cordova-ios.
Hello @ahmadalfy @renatoflorencia and @brodybits , this error arose after the last update of Xcode since before if it worked normally. The Xcode version I try is the following * 11.0 (11A420a) *
I have tried to execute several commands and modify the build files of the project (ios) but I have not obtained any positive results
List of commands executed:
ionic cordova build ios --prod
ionic cordova build ios
ionic cordova build ios - - buildFlag = "UseModernSystem = 0
ionic cordova build --prod --release ios
ionic cordova build ios --release --prod --device --buildFlag = "- UseModernBuildSystem = 0" --packageType = "app-store
ionic cordova build ios --release --device --buildFlag = "- UseModernBuildSystem = 0" --packageType = "app-store"
and none of these worked for a successful compilation.
###Ionic Info:
Ionic:
ionic (Ionic CLI) : 4.1.1 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.0
Cordova:
cordova (Cordova CLI) : 8.1.2 ([email protected])
Cordova Platforms : android 7.1.4, ios 4.5.5
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.2, cordova-plugin-ionic-webview 2.1.4, (and 13 other plugins)
System:
ios-deploy : 2.0.0
NodeJS : v8.11.4 (/usr/local/bin/node)
npm : 5.10.0
OS : macOS
Xcode : Xcode 11.0 Build version 11A420a`
from cordova-ios.
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.
from cordova-ios.
Related Issues (20)
- cordova ios not injecting referrerpolicy into iframe url calls HOT 7
- Loading HTML from the data directory with WKWebView results in an error HOT 1
- Cannot read property 'name' of undefined xcode@15 ios17
- Cannot read property 'name' of undefined xcode@15 ios17 HOT 2
- Webview Serving HOT 2
- Xcode 15.0: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.0.99. HOT 15
- Allow to configure a default simulator instead of always using --target on `cordova run` HOT 1
- Failing to broadcast 'pause' event when app enters background
- xcodebuild was not found. After upgrading to Cordova 7.0.1 from Cordova 6.1.0 HOT 3
- warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 12.0 to 17.0.99 HOT 2
- Unable to configure icons for Catalyst
- Undefined symbols on Xcode HOT 3
- Version 17 breaks podfile with deployment-target HOT 2
- 每次从后台进入前台UIApplicationDidBecomeActiveNotification这个方法执行有问题 HOT 1
- Cordova was listed on the list of requirements for third-party SDKs announced by Apple today. HOT 50
- Failed to verify code signature of some framework and cannot install on device HOT 3
- (Black screen) when App Reload is triggered on iPhones with Notch:
- Console.log is not displayed in the safari terminal, but is displayed in the Xcode console HOT 1
- App stuck on splash screen on ios 16+ HOT 5
- Cordova iOS How to inject local cordova.js to remote H5 calls. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cordova-ios.