Xcode 11在运行iPhone 13.1应用程序时崩溃。

27

我今天更新了Xcode(版本为11.0),现在每次尝试在我的iPhone(iOS 13.1)上运行任何项目时都会崩溃。

已经尝试过:

  • 清理派生数据
  • 清理库缓存文件夹
  • 卸载xCode并从商店重新下载
  • 重启Mac
  • 重启iPhone
  • 通过iTunes重新连接iPhone

奇怪的是,Xcode活动没有显示“安装应用程序”阶段,直接进入“在设备上运行应用程序”,然后崩溃。在模拟器上运行没有问题。

已经在Apple论坛上搜索并向Apple发送了报告,但也许有些事情我可以做来解决这个问题。

错误日志:

Process:               Xcode [873]
Path:                  /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier:            com.apple.dt.Xcode
Version:               11.0 (14936)
Build Info:            IDEFrameworks-14936000000000000~3
App Item ID:           497799835
App External ID:       832762837
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           Xcode [873]
User ID:               502

Date/Time:             2019-09-25 11:47:10.497 -0300
OS Version:            Mac OS X 10.14.6 (18G95)
Report Version:        12
Anonymous UUID:        XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX


Time Awake Since Boot: 550 seconds

System Integrity Protection: enabled

Crashed Thread:        16  Dispatch queue: Mutex to protect _hasPerformedWorkerAction

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Application Specific Information:
com.apple.main-thread
ProductBuildVersion: 11A420a
UNCAUGHT EXCEPTION (NSInternalInconsistencyException): Invalid parameter not satisfying: aString != nil
UserInfo: (null)
Hints: 
  0: Calling block provided to DVTSyncPerformBlock() here:

  0   DVTSyncPerformBlock (in DVTFoundation)
  1   -[IDEExecutionRunnableTracker executionWantsHold:withError:] (in IDEFoundation)
  2   -[IDERunOperationWorker _startWithRetrying:] (in IDEFoundation)
  3   __44-[IDERunOperationWorker _startWithRetrying:]_block_invoke_3 (in IDEFoundation)
  4   __48-[DVTDispatchLock_Recursive performLockedBlock:]_block_invoke (in DVTFoundation)
  5   _dispatch_client_callout (in libdispatch.dylib)
  6   _dispatch_lane_barrier_sync_invoke_and_complete (in libdispatch.dylib)
  7   DVTDispatchBarrierSync (in DVTFoundation)
  8   -[DVTDispatchLock performLockedBlock:] (in DVTFoundation)
  9   -[DVTDispatchLock_Recursive performLockedBlock:] (in DVTFoundation)
 10   __44-[IDERunOperationWorker _startWithRetrying:]_block_invoke_2 (in IDEFoundation)
 11   __DVT_CALLING_CLIENT_BLOCK__ (in DVTFoundation)
 12   __DVTDispatchAfter_block_invoke (in DVTFoundation)
 13   _dispatch_client_callout (in libdispatch.dylib)
 14   _dispatch_continuation_pop (in libdispatch.dylib)
 15   _dispatch_source_invoke (in libdispatch.dylib)
 16   _dispatch_continuation_pop (in libdispatch.dylib)
 17   _dispatch_async_redirect_invoke (in libdispatch.dylib)
 18   _dispatch_root_queue_drain (in libdispatch.dylib)
 19   _dispatch_worker_thread2 (in libdispatch.dylib)
 20   _pthread_wqthread (in libsystem_pthread.dylib)
 21   start_wqthread (in libsystem_pthread.dylib)

Backtrace:
  0   __exceptionPreprocess (in CoreFoundation)
  1   DVTFailureHintExceptionPreprocessor (in DVTFoundation)
  2   objc_exception_throw (in libobjc.A.dylib)
...
...
...
    0x7fff63005000 -     0x7fff6300affb  libunwind.dylib (35.4) <24A97A67-F017-3CFC-B0D0-6BD0224B1336> /usr/lib/system/libunwind.dylib
    0x7fff6300b000 -     0x7fff6303afff  libxpc.dylib (1336.261.2) <7DEE2300-6D8E-3C00-9C63-E3E80D56B0C4> /usr/lib/system/libxpc.dylib

External Modification Summary:
  Calls made by other processes targeting this process:
    task_for_pid: 1
    thread_create: 0
    thread_set_state: 0
  Calls made by this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by all processes on this machine:
    task_for_pid: 430
    thread_create: 0
    thread_set_state: 21

VM Region Summary:
ReadOnly portion of Libraries: Total=1.1G resident=0K(0%) swapped_out_or_unallocated=1.1G(100%)
Writable regions: Total=1.2G written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=1.2G(100%)

                                VIRTUAL   REGION 
REGION TYPE                        SIZE    COUNT (non-coalesced) 
===========                     =======  ======= 
Accelerate framework               640K        5 
Activity Tracing                   256K        1 
CG backing stores                 1160K        2 
CG image                          1296K       95 
CG raster data                      56K        6 
CoreAnimation                     25.8M      164 
CoreGraphics                         8K        1 
CoreImage                          776K       81 
CoreUI image data                 3000K       34 
CoreUI image file                  688K       14 
Dispatch continuations            8192K        1 
Foundation                         344K        5 
Image IO                            80K        5 
JS JIT generated code              1.0G        3 
Kernel Alloc Once                 1036K        2 
MALLOC                           136.4M      116 
MALLOC guard page                   48K       10 
Memory Tag 242                      12K        1 
Memory Tag 251                      64K        3 
Performance tool data             8208K        1         not counted in TOTAL below
SQLite page cache                  128K        2 
STACK GUARD                       56.1M       23 
Stack                             19.2M       23 
VM_ALLOCATE                        360K       24 
WebKit Malloc                     1144K        3 
__DATA                            94.4M      755 
__DATA_CONST                         8K        1 
__FONT_DATA                          4K        1 
__LINKEDIT                       357.4M      236 
__TEXT                           723.4M      680 
__UNICODE                          564K        1 
libnetwork                        1152K        4 
mapped file                      169.2M      230 
shared memory                      676K       15 
===========                     =======  ======= 
TOTAL                              2.6G     2547 

Model: MacBookPro12,1, BootROM 186.0.0.0.0, 2 processors, Intel Core i5, 2,9 GHz, 8 GB, SMC 2.28f7
Graphics: kHW_IntelIris6100Item, Intel Iris Graphics 6100, spdisplays_builtin
Memory Module: BANK 0/DIMM0, 4 GB, DDR3, 1867 MHz, 0x80AD, 0x483943434E4E4E424C54424C41522D4E5544
Memory Module: BANK 1/DIMM0, 4 GB, DDR3, 1867 MHz, 0x80AD, 0x483943434E4E4E424C54424C41522D4E5544
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x133), Broadcom BCM43xx 1.0 (7.77.61.2 AirPortDriverBrcmNIC-1305.8)
Bluetooth: Version 6.0.14d3, 3 services, 27 devices, 1 incoming serial ports
Network Service: Wi-Fi, AirPort, en0
Serial ATA Device: APPLE SSD SM0512G, 500,28 GB
USB Device: USB 3.0 Bus
USB Device: Bluetooth USB Host Controller
USB Device: iPhone
Thunderbolt Bus: MacBook Pro, Apple Inc., 27.1

Xcode 11.0是否支持iOS 13.1?您可能需要安装Xcode 11.1才能在运行iOS 13.1的iPhone上运行您的应用程序。 - Swift Dev Journal
是的,您可以在这里看到,Xcode 11支持开发运行iOS 13.1的设备 - alxlives
我遇到了这样的崩溃。我的解决方案是将新的BT后台隐私字符串添加到应用程序的plist文件中。 - Saa
面临同样的问题。我的Xcode是11,我尝试在iPhone XS(iOS 14.0.1)上运行它。在运行应用程序之前,我已经添加了设备支持(https://github.com/filsv/iPhoneOSDeviceSupport)。但是它并没有起作用。有什么解决办法吗? - Biswajit Karmakar
5个回答

26

所以,我发现在这个文件夹里面:

~/Library/Developer/Xcode/iOS DeviceSupport

Xcode会为所有已配对的物理设备符号创建缓存文件夹。

即使您卸载Xcode,此文件夹仍然存在,并且即使安装其他版本的软件,缓存也会被重复使用。

删除文件夹内容会导致Xcode重新下载符号,运行准备设备的调试支持阶段并重置设备连接,从而解决问题。


2
我的XS在每次调试应用程序启动时都会死机。重新下载调试支持文件有所帮助。谢谢! - heyfrank
1
iOS DeviceSupport 就是一个损坏的别名,对我来说一无是处...它指向了空白。不确定为什么会发生这种情况,但删除它可以解决我的问题。现在那里有一个适当的文件夹,其中包含你提到的缓存。 - RTHarston
2
只是为了说明:如果您在删除文件夹后立即尝试打开模拟器,它将无法加载。您需要先打开Xcode才能获得下载提示。 - Daniel Bachhuber
1
你节省了我的时间 +1 - Shahbaz Akram
@alxlives 我似乎找不到那个文件夹。 - Alex Tănăsescu

4

根据@alxlives的说法,“删除文件夹内容使Xcode重新下载符号,运行设备准备调试支持阶段并重置设备连接,从而解决了问题。” 这个解决方案对我有帮助。这是一个终端命令,可用于删除文件夹中的所有内容。

rm -r ~/Library/Developer/Xcode/iOS\ DeviceSupport/

这个命令将删除位于“设备支持”文件夹中的所有文件。


2

1.进入项目文件夹 图片描述

2.右键点击xcodeproj文件 图片描述

3.点击“显示包内容” 图片描述

4.删除xcuserdata目录 图片描述


1

我在使用运行iOS 13.2.3的iPhone XR和Xcode 11.1时遇到了问题(iPad在该操作系统版本下运行正常)。接受的答案对我无效。升级到Xcode 11.2.1解决了这个问题。


1
我在XCode 11.3上也遇到了同样的崩溃问题。我进入了".xcworkspace"工作空间目录的"显示包内容"(右键单击),并删除了"xcuserdata"文件夹。这解决了我的崩溃问题。

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