React Native 应用在 iOS 上运行 release 或 debug 版本时崩溃。

3

这是崩溃报告:

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Termination Reason: DYLD 1 Library missing
Library not loaded: @rpath/double-conversion.framework/double-conversion
Referenced from: <FC807FC8-F29C-3926-8FD2-B52AB0C43805> /Users/USER/Library/Developer/CoreSimulator/Devices/9DC328E5-38CB-4BAE-AA0F-E2976C0765E4/data/Containers/Bundle/Application/EFC99D36-68DA-47EB-A147-602CC1AE1B59/tekvetek_RN.app/tekvetek_RN
Reason: tried: '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/double-conversion.framework/double-conversion' (errno=2), '/usr/lib/swift/double-conversion.framework/double-conversion' (errno=2, no dyld cache), '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/double-conversion.framework/double-conversion' (errno=2), '/usr/lib/swift/double-conversion.framework/double-conversion' (errno=2, no dyld cache), '/Users/omerkocer/Libra
(terminated at launch; ignore backtrace)

Triggered by Thread:  0

Thread 0 Crashed:
0   ???                                    0x1062d6940 ???
1   <translation info unavailable>         0x1063636fc ???
2   dyld                                   0x206696a72 abort_with_payload_wrapper_internal + 80
3   dyld                                   0x206696aa4 abort_with_payload + 9
4   dyld_sim                               0x10ea79593 abort_with_payload + 26
5   dyld_sim                               0x10ea26f1e dyld4::halt(char const*) + 375
6   dyld_sim                               0x10ea24f75 dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 3928
7   dyld_sim                               0x10ea251a0 _dyld_sim_prepare + 442
8   dyld                                   0x206640b78 dyld4::prepareSim(dyld4::RuntimeState&, char const*) + 1265
9   dyld                                   0x20663f70e dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 244
10  dyld                                   0x20663f4e4 start + 388

Thread 1:: com.apple.rosetta.exceptionserver
0   ???                                 0x7ff7ffeed944 ???
1   ???                                 0x7ff7fff061f0 ???


Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000000000006  rbx: 0x000000000000010b  rcx: 0x0000000000000001  rdx: 0x000000030efbe6c0
  rdi: 0x000000200ea28d03  rsi: 0x000000030efbe390  rbp: 0x0000000000000000  rsp: 0x000000030efbe2c0
   r8: 0x000000030efbe2c0   r9: 0x0000000000000000  r10: 0x000000000000010b  r11: 0xfefefefefefefeff
  r12: 0x000000000000010b  r13: 0x000000030efbe6c0  r14: 0x0000000000000001  r15: 0x0000000000000006
  rip: <unavailable>       rfl: 0x0000000000000283
 tmp0: 0xffffffffffffffff tmp1: 0x00000001062d6914 tmp2: 0x0000000206696a72


Binary Images:
               0x0 - 0xffffffffffffffff ??? (*) <00000000-0000-0000-0000-000000000000> ???
       0x20663a000 -        0x2066a5fff dyld (*) <71febccd-d9dc-3599-9971-2b3407c588a8> /usr/lib/dyld
       0x10ea23000 -        0x10ea82fff dyld_sim (*) <db2ea9eb-03d5-3b81-a6ce-26ec4dd81b07> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/dyld_sim

Error Formulating Crash Report:
dyld_process_snapshot_get_shared_cache failed

EOF

据我所知,它崩溃是因为找不到@rpath/double-conversion.framework/double-conversion库。

我尝试使用库链接二进制文件:

  • libDoubleConversion.a
  • double-conversion.xcframework

但仍然相同。

顺便说一句,应用程序在构建后使用npx react-native run-ios或在Xcode中运行时不会崩溃。但是,使用npx react-native run-ios --configuration=debug--configuration=release在启动时会导致应用程序崩溃,出现EXC_CRASH (SIGABRT)错误。

1个回答

1
项目 > 目标 > 构建阶段 > 链接二进制文件库

Status = Optional

我改变了这个库的状态。
  • libDoubleConversion.a

  • double-conversion.xcframework

从"可选的"转为"必需的"。这对我很有用。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接