You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

React Native iOS复制Debug2配置后启动崩溃问题求助

React Native iOS 自定义Debug2配置崩溃及链接错误问题

我正在尝试为React Native应用配置新的iOS Debug环境,将默认的Debug配置复制为Debug2。运行npx react-native run-ios使用Debug配置时一切正常,但执行npx react-native run-ios --configuration Debug2时,应用虽成功编译安装到模拟器却立即崩溃,崩溃日志如下:

Last Exception Backtrace:
0   CoreFoundation                         0x1037817bc __exceptionPreprocess + 160
1   libobjc.A.dylib                        0x101209144 objc_exception_throw + 56
2   MultiConfigDemo                        0x1002751a4 RCTGetFatalHandler + 0 (RCTAssert.m:161)
3   MultiConfigDemo                        0x10028b228 __28-[RCTCxxBridge handleError:]_block_invoke + 608
4   libdispatch.dylib                      0x1015b1fa4 _dispatch_call_block_and_release + 24
5   libdispatch.dylib                      0x1015b3768 _dispatch_client_callout + 16
6   libdispatch.dylib                      0x1015c3018 _dispatch_main_queue_drain + 1220
7   libdispatch.dylib                      0x1015c2b44 _dispatch_main_queue_callback_4CF + 40
8   CoreFoundation                         0x1036e5ca4 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
9   CoreFoundation                         0x1036e0360 __CFRunLoopRun + 1956
10  CoreFoundation                         0x1036df7a4 CFRunLoopRunSpecific + 584
11  GraphicsServices                       0x105a9fc98 GSEventRunModal + 160
12  UIKitCore                              0x11921237c -[UIApplication _run] + 868
13  UIKitCore                              0x119216374 UIApplicationMain + 124
14  MultiConfigDemo                        0x1001fc0f0 main + 100 (main.m:8)
15  dyld_sim                               0x100b11fa0 start_sim + 20
16  dyld                                   0x100bf1f28 start + 2236
17  ???                             0xe156000000000000 ???

项目基于npx react-native init MultiConfigDemo初始化,仅做了两处修改:

  • 复制默认Debug配置为Debug2,无其他设置变更
  • 执行npx pod-install后的变更

我的环境是Xcode 14.2、M1芯片。

曾尝试在Podfile中添加以下配置:

project 'MultiConfigDemo', 'Debug2' => :debug

但构建Debug2时出现链接错误:

▸ Running script '[CP] Check Pods Manifest.lock'
▸ Running script 'Start Packager'
▸ Compiling AppDelegate.mm
▸ Compiling MultiConfigDemo_vers.c
▸ Compiling main.m
▸ Linking MultiConfigDemo

❌  ld: symbol(s) not found for architecture arm64

❌  clang: error: linker command failed with exit code 1 (use -v to see invocation)

请问有人成功实现过这类复制Debug配置的操作吗?


内容的提问来源于stack exchange,提问作者Tyler

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.11 02:04:55