Skip to content
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

Failure to launch: iOS simulator #23

Open
BigAB opened this issue Sep 29, 2017 · 15 comments
Open

Failure to launch: iOS simulator #23

BigAB opened this issue Sep 29, 2017 · 15 comments

Comments

@BigAB
Copy link

BigAB commented Sep 29, 2017

Not sure where the actual root of the problem is, whether it's x-code 9, or the lates ios-sim version or what, but when trying to launch the demo from this repository:

image

output

** BUILD SUCCEEDED **


No target specified for emulator. Deploying to undefined simulator


Device type "com.apple.CoreSimulator.SimDeviceType.undefined" could not be found.

Done-> cordova emulate ios
Error-> with Parallel tasks1

...and no simulator launches.

This is the same error i get when running the DoneJS Cordova build (donejs build cordova) as well, so currently the guides are not working fully on iOS.

Here is an ios-sim issue possibly related:
ios-control/ios-sim#218

@marshallswain
Copy link

marshallswain commented Oct 3, 2017

I'm having this same issue with adding cordova to a donejs app.

I tried creating a Cordova build separately, using their CLI, and was able to use the new commands to launch apps (I think the CLI API has changed). The new commands are here: https://gist.github.com/marshallswain/e9088589bfca88c43179ad588569cb7d

I haven't gone back to check if these new commands work with a DoneJS app.

@marshallswain
Copy link

The error that I get with a new DoneJS app is this

...
...
Done-> cordova plugin add cordova-plugin-transport-security
Success-> with Series tasks
Success-> with Series tasks
Potentially unhandled rejection [1] TypeError: Cannot read property 'dest' of undefined
    at /Users/marshall/Sites/my-project-name/node_modules/steal-cordova/lib/steal-cordova.js:127:25
    at tryCatch (/Users/marshall/Sites/my-project-name/node_modules/es6-promise/dist/es6-promise.js:416:12)
    at invokeCallback (/Users/marshall/Sites/my-project-name/node_modules/es6-promise/dist/es6-promise.js:431:13)
    at publish (/Users/marshall/Sites/my-project-name/node_modules/es6-promise/dist/es6-promise.js:399:7)
    at flush (/Users/marshall/Sites/my-project-name/node_modules/es6-promise/dist/es6-promise.js:126:5)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)
Bitovis-MacBook-Pro-2:my-project-name marshall$

@marshallswain
Copy link

marshallswain commented Oct 4, 2017

I tried cd my-project/build/cordova then cordova run ios --emulator --target="iPad-Air", and the build succeeds, but I get the error

** BUILD SUCCEEDED **

No available runtimes could be found for "iPad Air".

I think this steal-cordova must be running an older version of Cordova than the latest one I used in with the Cordova CLI.

Update: ok, maybe not. It looks like steal-cordova uses the latest version from npm: https://github.com/stealjs/steal-cordova/blob/master/package.json#L30

https://www.npmjs.com/package/cordova

@marshallswain
Copy link

Looking further into this error:

Potentially unhandled rejection [1] TypeError: Cannot read property 'dest' of undefined
    at /Users/marshall/Sites/my-project-name/node_modules/steal-cordova/lib/steal-cordova.js:127:25

stealTools.build is returning undefined

if(buildCordova) {
  buildPromise.then(config => {
    console.log(config) // undefined, undefined
    // stealCordova.build(config)
  })
  // .then(stealCordova.ios.emulate);
}

@marshallswain
Copy link

The problem seems to be here: https://github.com/stealjs/steal-bundler/blob/master/lib/inferred.js#L27

We're looping with bundles.map, but since handler is undefined, that function returns an implicit undefined. Maybe @matthewp or @m-mujica can weigh in on a fix.

@matthewp
Copy link
Member

matthewp commented Oct 4, 2017

I'll take a look, thanks.

@matthewp
Copy link
Member

matthewp commented Oct 4, 2017

@pYr0x Fixed it so that steal-bundler returns the buildResult always... I think maybe I just need to do a release.

@marshallswain
Copy link

Thanks, @matthewp. Please let me know. We need this for a client we're starting tomorrow.

@matthewp
Copy link
Member

matthewp commented Oct 4, 2017

Just released steal-bundler 0.3.3, let me know if that fixes your issue.

@matthewp
Copy link
Member

matthewp commented Oct 4, 2017

Woops, actually the version number is wrong, let me try again.

@matthewp
Copy link
Member

matthewp commented Oct 4, 2017

Ok, 0.3.4 is the number.

@marshallswain
Copy link

@matthewp that fixed the issue that I was having. Thanks!

Now I've graduated to having the same issue as @BigAB's first comment.

This does seem to be a Cordova issue, as the list of iOS devices is empty when I cd build/cordova and run cordova emulate ios --list. If I try to cordova add ios I get a message stating that it's already added.

I'm able to work around it by opening the project's workspace file in XCode and running the build from there:

screen shot 2017-10-04 at 7 25 04 am

@sanylop
Copy link

sanylop commented Jan 4, 2019

To solve this problem you only have to go to platforms/ios/cordova and execute this command:
npm install ios-sim@latest
in this directory!

Best,
Sanylop

@fayme
Copy link

fayme commented Apr 1, 2019

@sanylop not working

@Kunj-Choksi
Copy link

Kunj-Choksi commented Aug 9, 2020

@fayme
any success for this one. Just Tired of launching the app every time from Xcode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants