I have a React Native app that I'm trying to run on the iOS Simulator on my laptop. To launch this, I do npm start from my project directory, which shows the nice Metro icon then
r - reload the app
d - open developer menu
i - run on iOS
a - run on Android
Before, when I hit i, it would work the majority of the time but sometimes get hung up on a particular step. After some recent changes and installing a new library (and successfully doing npx pod-install), it's now getting hung up on the same step every time.
The step is: after hitting i, I get this:
info Opening the app on iOS...
info Found Xcode workspace "notoapprn.xcworkspace"
info Found booted iPhone 14
info Launching iPhone 14
info Building (using "xcodebuild -workspace notoapprn.xcworkspace -configuration Debug -scheme notoapprn -destination id=5655375F-31B9-47EC-9DD1-196F4CB8C86D")
info 💡 Tip: Make sure that you have set up your development environment correctly, by running react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor
Command line invocation:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace notoapprn.xcworkspace -configuration Debug -scheme notoapprn -destination id=5655375F-31B9-47EC-9DD1-196F4CB8C86D
User defaults from command line:
IDEPackageSupportUseBuiltinSCM = YES
Prepare packages
ComputeTargetDependencyGraph
note: Building targets in dependency order
note: Target dependency graph (68 targets)
Target 'notoapprn' in project 'notoapprn'
➜ Explicit dependency on target 'NotoMeShare' in project 'notoapprn'
➜ Implicit dependency on target 'Pods-notoapprn' in project 'Pods' via file 'libPods-notoapprn.a' in build phase 'Link Binary'
➜ Implicit dependency on target 'CocoaAsyncSocket' in project 'Pods' via options '-lCocoaAsyncSocket' in build setting 'OTHER_LDFLAGS'
➜ Implicit dependency on target 'DoubleConversion' in project 'Pods' via options '-lDoubleConversion' in build setting 'OTHER_LDFLAGS'
...
and many more lines noting Targets and their explicit / implicit dependencies. However, when it gets hung up, it'll literally print only part of a line, then nothing continues to happen, eg:
➜ Implicit dependency on target 'RCT-Folly' in project 'Pods' via options '-lRCT-Folly' in build setting 'OTHER_LDFLAGS'
➜ Implicit dependency on target 'RCTTypeSafety' in project 'Pods' via options '-lRCTTypeSafety' in build setting 'OTHER_LDFLAGS'
➜ Implicit dependency on target 'RNShareMenu' in project 'Pods' via options '-lRNShareMenu' in build setting 'OTHER_LDFLAGS'
➜ Implicit dependency on target 'React-Codegen' in project 'Pods' via op
The line is seemingly broken partway through.
More mysteriously, if I cancel this command and try running it all again, it'll get hung up again but possibly in a different spot in the list of targets/dependencies.
Any tips on debugging this?
I'm guessing what this is is a silent failure.
To build it another way, I went to XCode and tried to build the app with a target of the iPhone 14 simulator. When that tried to build, it threw errors - this helped me actually find the bug and fix it.
I'm guessing when you try to do it via the Terminal / Metro, it just silently fails, thus making it seem like it hangs in the middle of the targets and dependencies list.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With