Giter Club home page Giter Club logo

Comments (27)

JillevdW avatar JillevdW commented on May 31, 2024 33

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.

Matttaylor8910 avatar Matttaylor8910 commented on May 31, 2024 4

Why is this closed? This still happens with the latest cordova release installed

from cordova-ios.

waflessnet avatar waflessnet commented on May 31, 2024 3

@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.

ahmadalfy avatar ahmadalfy commented on May 31, 2024 2

I have cordova 9.0.0 ([email protected]) and xCode Version 11.0 (11A420a). Still facing this issue

from cordova-ios.

janpio avatar janpio commented on May 31, 2024 1

Create a new issue with all the ncessary information please. Thanks.

from cordova-ios.

brodybits avatar brodybits commented on May 31, 2024 1

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.

kashban avatar kashban commented on May 31, 2024

I already made a Pull request to fix this:

#428

from cordova-ios.

lynzz avatar lynzz commented on May 31, 2024

@kashban Thanks, why would I use xcode 9.4 reported that such a mistake,for macOS 10.14.1 Beta ?

from cordova-ios.

kashban avatar kashban commented on May 31, 2024

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.

lynzz avatar lynzz commented on May 31, 2024

@kashban I merged your PR code, the same error occurs

from cordova-ios.

kashban avatar kashban commented on May 31, 2024

@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.

csabbey avatar csabbey commented on May 31, 2024

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.

kashban avatar kashban commented on May 31, 2024

That's exactly the issue my PR fixes.

from cordova-ios.

csabbey avatar csabbey commented on May 31, 2024

@kashban Yes, it looks like the same issue.

from cordova-ios.

kashban avatar kashban commented on May 31, 2024

@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.

felimoles avatar felimoles commented on May 31, 2024

in xcode > 10 dont work :(

from cordova-ios.

kennybky avatar kennybky commented on May 31, 2024

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.

kashban avatar kashban commented on May 31, 2024

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.

Ramprasathselvam avatar Ramprasathselvam commented on May 31, 2024
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.

joeldhenry avatar joeldhenry commented on May 31, 2024

this started happening on xcode 10.2.1 and i have no solution to get it working again :(

from cordova-ios.

lucasgalli avatar lucasgalli commented on May 31, 2024

it's happening in Xcode 10.2.1 and i didn't find any solution.

from cordova-ios.

lucasgalli avatar lucasgalli commented on May 31, 2024

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.

derman10 avatar derman10 commented on May 31, 2024

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;
}, []);

this solved my problem!
Thanks!!

from cordova-ios.

renatoflorencia avatar renatoflorencia commented on May 31, 2024

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.

brodybits avatar brodybits commented on May 31, 2024

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.

osmanc777 avatar osmanc777 commented on May 31, 2024

Captura de Pantalla 2019-09-25 a la(s) 16 19 34

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.

brodybits avatar brodybits commented on May 31, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.