在iOS 10.1.1上运行应用程序的Xcode 9在启动时崩溃

在iOS 10.1.1上运行应用程序的Xcode 9在启动时崩溃

问题描述:

我开发了一款针对iOS 10.0+的应用,但仅在设备上测试过。运行iOS 11.0 +的模拟器。

I developed an app targeting iOS 10.0+ but tested only on devices & simulators running iOS 11.0+.

我连接了运行iOS 10.1.1的iPhone 6,点击运行和应用程序在启动时崩溃,控制台中没有记录错误,只是在 AppDelegate 上崩溃。

I hooked up an iPhone 6 running iOS 10.1.1, hit Run and the app crashes on launch with no error logged in the console, just crashes on AppDelegate.

我做的一个发现,当我去我的故事板并完全空的 ViewController 作为初始ViewController 时,该应用程序运行完美。
我已将我开发的其他屏幕设置为初始ViewController ,有些崩溃,有些则没有。
我认为这些屏幕之间没有任何差异(不是在VC设置或类别中)。

A discovery I made, is when I went to my storyboard and made a totally empty ViewController as the Initial ViewController, the app runs perfectly. I have set other screens I have developed as the Initial ViewController, some crash and some don't. I don't see any difference among those screens at all (not in the VCs settings or the classes).

可能是什么问题?我非常沮丧:(

What could be the issue? I am totally frustrated :(

编辑:我尝试了以下方法:删除并重新安装应用,清洁CMD + Shift + K& Run,删除Xcode的派生数据。没有一个工作。

编辑2:我已经下载了一个10.1模拟器,我收到了这个错误log:

[] __nwlog_err_simulate_crash_libsystem libsystem simulate crash unavailable "libsystem_network.dylib: nw_host_stats_add_src :: received error for SRC_ADDED: [22] Invalid argument"
2017-10-25 16:39:22.478543 Tuttnauer Wi-Fi Connect[40460:11666750] [] nw_host_stats_add_src received error for SRC_ADDED: [22] Invalid argument, dumping backtrace:
        [x86_64] libnetcore-856.20.4
    0   libsystem_network.dylib             0x0000000104eeb682 __nw_create_backtrace_string + 123
    1   libsystem_network.dylib             0x0000000104f02306 nw_get_host_stats + 1083
    2   libnetwork.dylib                    0x000000010669578b nw_endpoint_resolver_start_next_child + 1382
    3   libdispatch.dylib                   0x0000000104c68980 _dispatch_call_block_and_release + 12
    4   libdispatch.dylib                   0x0000000104c920cd _dispatch_client_callout + 8
    5   libdispatch.dylib                   0x0000000104c6fe6b _dispatch_queue_serial_drain + 236
    6   libdispatch.dylib                   0x0000000104c70b9f _dispatch_queue_invoke + 1073
    7   libdispatch.dylib                   0x0000000104c733b7 _dispatch_root_queue_drain + 720
    8   libdispatch.dylib                   0x0000000104c7308b _dispatch_worker_thread3 + 123
    9   libsystem_pthread.dylib             0x00000001050451ca _pthread_wqthread + 1387
    10  libsystem_pthread.dylib             0x0000000105044c4d start_wqthread + 13

在我的例子中,Interface Builder中的ViewController具有针对11.0设置的Builds 。将其更改为部署目标可以解决问题。

In my case, the ViewController in Interface Builder has Builds for set for 11.0. Changing it to Deployment Target fixes the issue.