Swift:iOS 12.2 应用程序在启动时崩溃 [英] Swift: iOS 12.2 Crash of the app on launch

查看:36
本文介绍了Swift:iOS 12.2 应用程序在启动时崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新 Xcode 和 swift 5 后,在 iOS 12.2 上启动模拟器后,我的应用程序在启动时崩溃.但在早期版本的 ios(如 12.0)中,应用程序可以正常工作.我在真机 ios 12.0.1 上启动应用程序,应用程序运行正常,然后在 iOS 设备 12.2 上启动应用程序,应用程序崩溃

after updating Xcode and swift 5, after launching the simulator on iOS 12.2 my application crash on launch. But in earlier versions of ios (like 12.0) the application works correctly. I launched the application on a real device ios 12.0.1 and the app is working properly, then launched the application on an iOS device 12.2 and the app crash

我不知道它是否相关,但在控制台中我有这条消息:

I do not know if it's related but in the console I have this message:

objc[39432]: Swift 类扩展和 Swift 类上的类别不允许有 +load 方法

objc[39432]: Swift class extensions and categories on Swift classes are not allowed to have +load methods

然后Xcode重定向到0_abort_with_payload:

Then Xcode redirects to 0_abort_with_payload:

    libsystem_kernel.dylib`__abort_with_payload:
    0x11365200c <+0>:  movl   $0x2000209, %eax          ; imm = 0x2000209 
    0x113652011 <+5>:  movq   %rcx, %r10
    0x113652014 <+8>:  syscall 
->  0x113652016 <+10>: jae    0x113652020               ; <+20>
    0x113652018 <+12>: movq   %rax, %rdi
    0x11365201b <+15>: jmp    0x113634457               ; cerror_nocancel
    0x113652020 <+20>: retq   
    0x113652021 <+21>: nop    
    0x113652022 <+22>: nop    
    0x113652023 <+23>: nop    

推荐答案

问题解决了;我使用 Swinject CocoaPod,所以在 Podfile 中我更新了该 pod 的相应行:

The problem is solved; I use the Swinject CocoaPod so in the Podfile I updated the corresponding line for that pod with:

pod 'SwinjectStoryboard', :git => 'https://github.com/mdyson/SwinjectStoryboard.git', :branch => 'master'`

这篇关于Swift:iOS 12.2 应用程序在启动时崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆