【问题标题】:Xcode 12 simulator crashXcode 12 模拟器崩溃
【发布时间】:2021-01-13 23:02:37
【问题描述】:

我在 Xcode 12 模拟器中遇到奇怪的崩溃,并在启动后立即发出信号 SIGABRT。它发生在 Xcode 12.0 和 Xcode 12.0.1 的已发布版本上 我已尝试使用最新的 beta 12.2。

应用在设备上运行良好。

由于日志较少,我无法追踪太多。以下是堆栈。

线程 1

dyld`__abort_with_payload:
0x1194b0ed4 <+0>:  movl   $0x2000209, %eax          ; imm = 0x2000209 
0x1194b0ed9 <+5>:  movq   %rcx, %r10
0x1194b0edc <+8>:  syscall 
->  0x1194b0ede <+10>: jae    0x1194b0ee8               ; <+20>
0x1194b0ee0 <+12>: movq   %rax, %rdi
0x1194b0ee3 <+15>: jmp    0x1194af408               ; cerror_nocancel
0x1194b0ee8 <+20>: retq   
0x1194b0ee9 <+21>: nop    
0x1194b0eea <+22>: nop    
0x1194b0eeb <+23>: nop    

添加异常断点后编辑,得到以下控制台输出

dyld: Library not loaded: /usr/lib/libnfshared.dylib
Referenced from: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreNFC.framework/CoreNFC
Reason: no suitable image found.  Did find:
/usr/lib/libnfshared.dylib: mach-o, but not built for platform iOS-sim

在我的项目中,我没有使用 CoreNFC。它没有链接,也没有被 pod 使用,我已经检查过了

【问题讨论】:

  • 这有什么帮助吗? stackoverflow.com/questions/42027601/…
  • Yes thread sanitizer if OFF Malloc is OFF Zombies are OFF 不使用自定义框架仅 Pod 和一些系统框架(adSupport、CoreTelephony 和 iAd)
  • 您拥有所有这些(广告、电话......)的权利?另外,您是否使用任何参数来运行它?
  • 您是否在 Xcode 中启用了异常断点?
  • @ArslanAsim 看起来像 iOS 14 中的一个错误:openradar.appspot.com/FB8699389

标签: ios objective-c swift xcode xcode12


【解决方案1】:

我的解决方案:手动将 libnfshared.dylib 从 Xcode 12 beta 6 复制到: Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/

这对我有用。 ?

如果您想避免为单个文件下载 11.25GB Xcode 12.2 测试版的麻烦。我有文件要分享。

您可以执行以下命令下载并放入Xcode包中:

sudo curl https://storage.googleapis.com/mobile-simulator-build/libnfshared.dylib -o /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libnfshared.dylib

希望对你有帮助?

【讨论】:

    【解决方案2】:

    我遇到了同样的问题,iOS14 的模拟器在启动后会立即崩溃。较旧的 iOS 模拟器和使用 iOS14 部署到设备上运行良好。

    我的解决方案: 手动将 libnfshared.dylib 从 Xcode 12 beta 6 复制到:

    Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/

    因为发布版本中似乎缺少此文件。

    【讨论】:

      【解决方案3】:

      我希望这会有所帮助:

      从 Target/App/Build Settings 中删除“VALID_ARCHS”。

      如果你有 Bitrise 版本,我建议添加:arm64 x86_64。 因为由于某种原因,如果删除“VALID_ARCHS”,Bitrise 目前会崩溃。

      例子:

      【讨论】:

        【解决方案4】:

        这个问题解决了

        Xcode-12.2 beta 2。于 2020 年 9 月 29 日发布。

        等待稳定版本,以确认一切是否按预期工作,如在测试版中工作。

        【讨论】:

          猜你喜欢
          • 2021-02-02
          • 2016-10-19
          • 1970-01-01
          • 1970-01-01
          • 2015-06-22
          • 2020-10-15
          • 1970-01-01
          • 2018-04-20
          • 1970-01-01
          相关资源
          最近更新 更多