我有一个React Native应用程序,我试图在笔记本电脑上的iOS模拟器上运行。为了启动它,我从我的项目目录中执行npm start
,然后显示漂亮的Metro图标
r - reload the app
d - open developer menu
i - run on iOS
a - run on Android
字符串
以前,当我点击i
时,它会在大多数时间工作,但有时会在特定的步骤上挂起。在最近的一些更改和安装新的库(并成功地做了npx pod-install
)之后,它现在每次都在同一个步骤上挂起。
步骤是:在点击i
之后,我得到了这个:
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'
...
型
还有更多的行,注明了Target和它们的显式/隐式依赖关系。然而,当它挂起时,它实际上只打印一行的一部分,然后什么也不会继续发生,例如:
➜ 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
型
这条线似乎断了一半。
更神秘的是,如果我取消这个命令并尝试再次运行它,它将再次挂起,但可能在目标/依赖项列表中的不同位置。
有什么关于调试的提示吗?
1条答案
按热度按时间dzjeubhm1#
我猜这是无声的失败
为了以另一种方式构建它,我去了XCode,并试图以iPhone 14模拟器为目标构建应用程序。当尝试构建时,它抛出了错误-这实际上帮助我找到了bug并修复了它。
我猜当你试图通过终端/地铁做这件事时,它只是默默地失败了,从而使它看起来像挂在目标和依赖列表的中间。