我使用crashlytics来获取我在AppStore中的应用程序的崩溃。一些用户正在崩溃,我似乎无法在我的机器上复制(也不是通过TestFlight测试我的应用程序的少数朋友)。这是布料的原木:
Thread : Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x181d09bdc objc_msgSend + 28
1 Foundation 0x18304be20 __NSThreadPerformPerform + 340
2 CoreFoundation 0x182640efc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
3 CoreFoundation 0x182640990 __CFRunLoopDoSources0 + 540
4 CoreFoundation 0x18263e690 __CFRunLoopRun + 724
5 CoreFoundation 0x18256d680 CFRunLoopRunSpecific + 384
6 GraphicsServices 0x183a7c088 GSEventRunModal + 180
7 UIKit 0x1873e4d90 UIApplicationMain + 204
8 <App Name> 0x1000b2f0c main (AppDelegate.swift:14)
9 libdispatch.dylib 0x18210e8b8 (Missing)我似乎不明白这意味着什么,也找不到其他问题寻求帮助,但似乎找不到答案。我也很快联系了破折主义者小组,他们告诉我如下:
听起来这次崩溃的根源是某种内存崩溃。这导致Crashlytics在完成写作之前关闭,导致您的崩溃报告中出现了这种情况。
有什么很好的方法来调试这个来找出崩溃的源头吗?感谢你的帮助!
编辑:在crashlytics的崩溃报告中添加了线程的屏幕截图,以防有人想从那里得到一些信息:

Thread : com.apple.NSURLConnectionLoader
0 libsystem_kernel.dylib 0x1823354bc mach_msg_trap + 8
1 libsystem_kernel.dylib 0x182335338 mach_msg + 72
2 CoreFoundation 0x182764ac0 __CFRunLoopServiceMachPort + 196
3 CoreFoundation 0x1827627c4 __CFRunLoopRun + 1032
4 CoreFoundation 0x182691680 CFRunLoopRunSpecific + 384
5 CFNetwork 0x182e01434 +[NSURLConnection(Loader) _resourceLoadLoop:] + 412
6 Foundation 0x18316fc40 __NSThread__start__ + 1000
7 libsystem_pthread.dylib 0x182417b28 _pthread_body + 156
8 libsystem_pthread.dylib 0x182417a8c _pthread_body + 154
9 libsystem_pthread.dylib 0x182415028 thread_start + 4
Thread : AVAudioSession Notify Thread
0 libsystem_kernel.dylib 0x1823354bc mach_msg_trap + 8
1 libsystem_kernel.dylib 0x182335338 mach_msg + 72
2 CoreFoundation 0x182764ac0 __CFRunLoopServiceMachPort + 196
3 CoreFoundation 0x1827627c4 __CFRunLoopRun + 1032
4 CoreFoundation 0x182691680 CFRunLoopRunSpecific + 384
5 libAVFAudio.dylib 0x188959834 GenericRunLoopThread::Entry(void*) + 164
6 libAVFAudio.dylib 0x18892e3a8 CAPThread::Entry(CAPThread*) + 84
7 libsystem_pthread.dylib 0x182417b28 _pthread_body + 156
8 libsystem_pthread.dylib 0x182417a8c _pthread_body + 154
9 libsystem_pthread.dylib 0x182415028 thread_start + 4编辑2:我使用的是所有Swift代码,我向选择器转发消息的方式如下:
NSTimer.scheduledTimerWithTimeInterval(0.02, target: self, selector: Selector("updateProgressCircle"), userInfo: nil, repeats: true)
func updateProgressCircle() {
// Do something
}问题是我不能在本地复制任何崩溃。只有用户才会面对这种情况。我以类似的方式调用选择器。
发布于 2016-03-09 18:12:19
当您试图将消息转发到选择器(使用好的旧目标-C转发消息)时,就会发生objc_msgSend崩溃。这可以由目标操作、通知、协议声明、计时器、执行选择器或传递函数的选择器语法(即:"doSomethingWithThis:" )产生。
我可以从您的崩溃日志中看到,您的应用程序中有快速组件(至少是AppDelegate)。与Obj组件不同的是,Swift组件与Obj转发消息系统不兼容。
我的直觉是,您的代码中有一个符合协议的快速对象,它作为目标/通知观察者添加,或者以某种方式期望通过转发消息来调用其功能之一。我建议你复习一下你的课程,看看是否是这样。一旦找到了罪魁祸首,就可以通过将@objc附加到期望消息的函数中来轻松地修复此错误。
如果您的函数在快速类中被调用(并且,比如说,注册为通知):
func yourFunction() {
//your code
}称之为:
@objc func yourFunction() {
//your code
}这是一个很长的机会,但我希望这会有所帮助!
发布于 2017-04-13 17:21:56
我相信这可能与AVAudioPlayer有关。在我的例子中,我有同样的错误,并通过注意到我的两个正在运行的线程中有与AVAudioPlayer相关的内容而得到了一些提示。
我有一个AVAudioPlayer类变量,我重新初始化了它,而没有首先重置为零。我在AVAudioPlayer变量初始化之前添加了下面的代码,此后就没有出现错误。
audioPlay是变量名。
if audioPlay != nil
{
//print( "blabla" )
audioPlay?.stop()
audioPlay = nil
}https://stackoverflow.com/questions/35836230
复制相似问题