Ignite: Xcode Simulator not found when running ios from a new Ignite project

Created on 6 Apr 2019  路  24Comments  路  Source: infinitered/ignite


What's going on?

A default macOS Simulator doesn't open when running ios project if the project is created with Ignite CLI.

If i generate the same base project with react-native then it does open the default iPhone X simulator.


Steps to reproduce

I created a project with
react-native init awesome
and then ran it with
react-native run-ios
and the Simulator opened and showed the app.

I created a project with
ignite n awesomeIgnite
and then ran it with
react-native run-ios
and no Simulator opens. An error instead:
```Found Xcode project awesomeIgnite.xcodeproj

Could not find iPhone X simulator

Error: Could not find iPhone X simulator
at resolve (/Users/mikec/Documents/code/mobile/awesomeIgnite/node_modules/react-native/local-cli/runIOS/runIOS.js:149:13)
at new Promise ()
at runOnSimulator (/Users/mikec/Documents/code/mobile/awesomeIgnite/node_modules/react-native/local-cli/runIOS/runIOS.js:134:10)
at Object.runIOS [as func] (/Users/mikec/Documents/code/mobile/awesomeIgnite/node_modules/react-native/local-cli/runIOS/runIOS.js:106:12)
at Promise.resolve.then (/Users/mikec/Documents/code/mobile/awesomeIgnite/node_modules/react-native/local-cli/cliEntry.js:117:22)


---
`ignite doctor` results:

```System
  platform           darwin
  arch               x64
  cpu                8 cores                                            Intel(R) Core(TM) i7-8559U CPU @ 2.70GHz
  directory          /Users/mikec/Documents/code/mobile/awesomeIgnite
vvv -----[ DEBUG ]----- vvv
{ Error: not found: yarn
    at getNotFoundError (/usr/local/lib/node_modules/ignite-cli/node_modules/gluegun/node_modules/which/which.js:13:12)
    at Function.whichSync [as sync] (/usr/local/lib/node_modules/ignite-cli/node_modules/gluegun/node_modules/which/which.js:131:9)
    at which (/usr/local/lib/node_modules/ignite-cli/node_modules/gluegun/src/core-extensions/system-extension.js:113:22)
    at Command.module.exports [as run] (/usr/local/lib/node_modules/ignite-cli/src/commands/doctor.js:45:20)
    at processTicksAndRejections (internal/process/task_queues.js:86:5) code: 'ENOENT' }
^^^ -----[ DEBUG ]----- ^^^

I don't have Yarn installed :)

bug

Most helpful comment

If you run rm -rf node_modules then npm install and npm audit fix it will open the iPhone X emulator but will give another error:

error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening Cestouapp.xcodeproj

** BUILD FAILED **

All 24 comments

Looking at RN local-cli/runIOS/runIOS.js it executes xcrun simctl list --json devices so am not sure what can be different between the generated projects that runIOS.js even cares about?

If I call react-native run-ios --simulator="iPhone 6" in the Ignite project folder I get the same simulator not found error - whatever phone model I specify.

If I do the same in the basic react-native project folder I get a different simulator, as specified, every time.

+1

If you run rm -rf node_modules then npm install and npm audit fix it will open the iPhone X emulator but will give another error:

error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening Cestouapp.xcodeproj

** BUILD FAILED **

Do you have the XCode commandline tools installed? xcode-select --install

Yes command line tools installed. Works fine with react-native tool direct.

Okay, can you either check the output for the actual error (it's usually 20-50 lines up) or open the project in XCode and try building it to see what error it returns?

On react-native run-ios:

info       facebook::jsc::JSCRuntime::createObject(std::__1::shared_ptr<facebook::jsi::HostObject>)::$_0::operator()() const in libReact.a(JSCRuntime.o)
      facebook::jsc::JSCRuntime::createFunctionFromHostFunction(facebook::jsi::PropNameID const&, unsigned int, std::__1::function<facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>)::$_1::operator()() const in libReact.a(JSCRuntime.o)

info ld: symbol(s) not found for architecture x86_64

info clang: error:

info linker command failed with exit code 1 (use -v to see invocation)

info

error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening Cestouapp.xcodeproj

** BUILD FAILED **


The following build commands failed:
        Ld /Users/cassiano/CISS/Cestouapp/ios/build/Cestouapp/Build/Products/Debug-iphonesimulator/Cestouapp.app/Cestouapp normal x86_64
(1 failure)

debug Error: Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening Cestouapp.xcodeproj

** BUILD FAILED **


The following build commands failed:
        Ld /Users/cassiano/CISS/Cestouapp/ios/build/Cestouapp/Build/Products/Debug-iphonesimulator/Cestouapp.app/Cestouapp normal x86_64
(1 failure)

    at ChildProcess.buildProcess.on.code (/Users/cassiano/CISS/Cestouapp/node_modules/@react-native-community/cli/build/commands/runIOS/runIOS.js:231:16)
    at ChildProcess.emit (events.js:193:13)
    at maybeClose (internal/child_process.js:1001:16)
    at Socket.stream.socket.on (internal/child_process.js:405:11)
    at Socket.emit (events.js:193:13)
    at Pipe._handle.close (net.js:614:12)

If I run on Xcode it gets 52 errors on the issues panel:

:-1: Undefined symbol: _JSClassCreate
:-1: Undefined symbol: _JSContextGetGlobalObject
:-1: Undefined symbol: _JSEvaluateScript
:-1: Undefined symbol: _JSGlobalContextCreateInGroup
:-1: Undefined symbol: _JSGlobalContextRelease
:-1: Undefined symbol: _JSGlobalContextRetain
:-1: Undefined symbol: _JSObjectCallAsConstructor
:-1: Undefined symbol: _JSObjectCallAsFunction
:-1: Undefined symbol: _JSObjectCopyPropertyNames
:-1: Undefined symbol: _JSObjectGetPrivate
:-1: Undefined symbol: _JSObjectGetProperty
:-1: Undefined symbol: _JSObjectGetPropertyAtIndex
:-1: Undefined symbol: _JSObjectGetPrototype
:-1: Undefined symbol: _JSObjectHasProperty
:-1: Undefined symbol: _JSObjectIsFunction
:-1: Undefined symbol: _JSObjectMake
:-1: Undefined symbol: _JSObjectMakeArray
:-1: Undefined symbol: _JSObjectSetPrivate
:-1: Undefined symbol: _JSObjectSetProperty
:-1: Undefined symbol: _JSObjectSetPropertyAtIndex
:-1: Undefined symbol: _JSObjectSetPrototype
:-1: Undefined symbol: _JSPropertyNameAccumulatorAddName
:-1: Undefined symbol: _JSPropertyNameArrayGetCount
:-1: Undefined symbol: _JSPropertyNameArrayGetNameAtIndex
:-1: Undefined symbol: _JSPropertyNameArrayRelease
:-1: Undefined symbol: _JSStringCreateWithUTF8CString
:-1: Undefined symbol: _JSStringGetMaximumUTF8CStringSize
:-1: Undefined symbol: _JSStringGetUTF8CString
:-1: Undefined symbol: _JSStringIsEqual
:-1: Undefined symbol: _JSStringRelease
:-1: Undefined symbol: _JSStringRetain
:-1: Undefined symbol: _JSValueIsArray
:-1: Undefined symbol: _JSValueIsBoolean
:-1: Undefined symbol: _JSValueIsInstanceOfConstructor
:-1: Undefined symbol: _JSValueIsNull
:-1: Undefined symbol: _JSValueIsNumber
:-1: Undefined symbol: _JSValueIsObject
:-1: Undefined symbol: _JSValueIsObjectOfClass
:-1: Undefined symbol: _JSValueIsString
:-1: Undefined symbol: _JSValueIsUndefined
:-1: Undefined symbol: _JSValueMakeBoolean
:-1: Undefined symbol: _JSValueMakeNull
:-1: Undefined symbol: _JSValueMakeNumber
:-1: Undefined symbol: _JSValueMakeString
:-1: Undefined symbol: _JSValueMakeUndefined
:-1: Undefined symbol: _JSValueProtect
:-1: Undefined symbol: _JSValueToBoolean
:-1: Undefined symbol: _JSValueToNumber
:-1: Undefined symbol: _JSValueToObject
:-1: Undefined symbol: _JSValueToStringCopy
:-1: Undefined symbol: _JSValueUnprotect
:-1: Undefined symbol: _kJSClassDefinitionEmpty

I saw someone mention on another thread that the simulator names have changed in the latest version of XCode, not sure if that's related or not. I've never seen the error you're getting.

I mentioned in comment 2 the simulator names work fine from the non Ignite project folder.

I also get the same build error as @cassianomon above.

Keep in mind, Ignite doesn't always use the latest RN version, so that could easily be the source of discrepancies between vanilla and Ignite, particularly when there are tooling changes and the fixes are only included in the bleeding-edge versions.

Should we open a new issue for the error after resolving simulator one?

I'm working on this (as well as the other errors reported). Thanks everyone for helping out!

The problem with ignite doctor when yarn is not installed is fixed in #1404, which has been deployed as 2.2.4. Upgrade with npm upgrade -g ignite-cli.

The latest version of Bowser (3.2.0) seems to fix this issue. Please re-try:

yarn global add ignite-cli
ignite new MyApp -b bowser --no-detox

Note that the feature generating Detox tests is currently broken; that's next on my list to work on.

With bowser it worked fine but with andross it still having the issue, should I open a new issue?

I thought the CLI tool would be where the simulator issue would have been. Strange.
What was the actual fix? I couldn't find it from looking at the commits to either repo.

With bowser it worked fine but with andross it still having the issue, should I open a new issue?

New issue opened on the boilerplate project - https://github.com/infinitered/ignite-andross/issues/263

The fix appears to be upgrading to 0.59.0.

@jamonholmgren just upgrading the RN version doesn't resolve the build fail that @cassianomon mentions earlier in comment https://github.com/infinitered/ignite/issues/1401#issuecomment-480997544

@budda FYI the Detox issue should be fixed on the latest Ignite CLI, 4.0.0-beta.3. Since that's tagged latest for dist-tags, it's easy to upgrade to:

yarn global add ignite-cli

I believe all outstanding major issues are fixed for Bowser. Andross still has an issue with its plugins and I'll work on that when I have time.

@budda FYI the Detox issue should be fixed on the latest Ignite CLI, 4.0.0-beta.3. Since that's tagged latest for dist-tags, it's easy to upgrade to:

yarn global add ignite-cli

I believe all outstanding major issues are fixed for Bowser. Andross still has an issue with its plugins and I'll work on that when I have time.

Assume you mean [email protected] which i got via npm. Is yarn still faster these days?

@budda Yarn is still faster for most things, yeah. I use it almost exclusively, but we do try to support both (albeit not for Ignite's source code itself). (And good catch, I did mean 3.0.0-beta.3)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

GantMan picture GantMan  路  3Comments

besingamkb picture besingamkb  路  3Comments

GantMan picture GantMan  路  3Comments

tayfunyasar picture tayfunyasar  路  3Comments

whalemare picture whalemare  路  3Comments