作者热门文章
- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
似乎很长一段时间一切都很好,昨天没有任何明显的原因我开始出错
EXC_BAD_ACCESS (code = EXC_I386_GPFLT)
在模拟器的下一行(在真实设备上一切正常):
GPPSignIn *signIn = [GPPSignIn sharedInstance];
启用 NSZombie 消息后更改为
exc_breakpoint (code=exc_i386_bpt subcode=0x0)
。
这很奇怪,因为即使这一行在 viewDidLoad 中只有一行,并且它是应用程序中的第一个 View Controller ,我也会一次又一次地出错(~每 3-4 个应用程序启动)。我没有对应用配置进行任何更改。
如有任何帮助,我将不胜感激。谢谢!
更新:libobjc.A.dylib
发生错误
如我所见。
更新:
更新:
2014-03-31 13:54:13.611 SomeApp[450:3c07] *** -[CFString retain]: message sent to deallocated instance 0x10c2ef050
(lldb) bt
* thread #6: tid = 0x2a3b, 0x0000000103978cc4 CoreFoundation`___forwarding___ + 772, queue = 'NSOperationQueue 0x10ea2b870', stop reason = EXC_BREAKPOINT (code=EXC_I386_BPT, subcode=0x0)
* frame #0: 0x0000000103978cc4 CoreFoundation`___forwarding___ + 772
frame #1: 0x0000000103978938 CoreFoundation`__forwarding_prep_0___ + 120
frame #2: 0x00000001039fb3c7 CoreFoundation`+[__NSArrayI __new:::] + 87
frame #3: 0x000000010395d386 CoreFoundation`+[NSArray arrayWithObjects:] + 566
frame #4: 0x00000001002dea06 SomeApp `+[GPPSignIn versionFromServerData:currentVersion:] + 832
frame #5: 0x00000001002dec24 SomeApp `__28-[GPPSignIn checkSDKVersion]_block_invoke + 197
frame #6: 0x0000000100277e64 SomeApp `-[GTMHTTPFetcher connectionDidFinishLoading:] + 714
frame #7: 0x000000010152036b Foundation`__65-[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:]_block_invoke + 48
frame #8: 0x000000010145763b Foundation`-[NSBlockOperation main] + 75
frame #9: 0x00000001014a5d34 Foundation`-[__NSOperationInternal _start:] + 623
frame #10: 0x00000001014a7c0b Foundation`__NSOQSchedule_f + 64
frame #11: 0x000000010414372d libdispatch.dylib`_dispatch_client_callout + 8
frame #12: 0x0000000104131eab libdispatch.dylib`_dispatch_async_redirect_invoke + 174
frame #13: 0x000000010414372d libdispatch.dylib`_dispatch_client_callout + 8
frame #14: 0x0000000104133b27 libdispatch.dylib`_dispatch_root_queue_drain + 380
frame #15: 0x0000000104133d12 libdispatch.dylib`_dispatch_worker_thread2 + 40
frame #16: 0x0000000104490ef8 libsystem_pthread.dylib`_pthread_wqthread + 314
(lldb)
最佳答案
这是一个需要追踪的奇怪问题。 [CFString retain]:
我一直遇到同样的问题,只在模拟器中崩溃(在设备上运行良好),但是当我尝试在 Instruments 中运行 Zombies 时,它永远不会显示僵尸。
经过大量搜索后,您的问题让我使用 backtrace 命令查明问题是由 Google+ SDK 引起的。
虽然这只是 Google 解决问题之前的一种解决方法,但您可以通过将 GPPSignIn
包装在预编译器指令中来检查您是否在模拟器中运行,从而让您的应用程序在模拟器上运行:
#if !(TARGET_IPHONE_SIMULATOR)
- (GPPSignIn *) googlePlusSession {
NSLog(@"Not running on simulator");
if(_googlePlusSession == nil) {
_googlePlusSession = [GPPSignIn sharedInstance];
_googlePlusSession.clientID = kGoogleClientId;
_googlePlusSession.scopes = [NSArray arrayWithObjects:kGTLAuthScopePlusLogin,nil];
_googlePlusSession.delegate = self;
[_googlePlusSession trySilentAuthentication];
}
return _googlePlusSession;
}
#endif
显然,当在模拟器上运行时,这会搞砸您的应用程序中的 Google+ 功能,但在我的情况下,这比根本无法启动要好得多。希望这会有所帮助。
关于ios - GPPSignIn 共享实例 -> EXC_BAD_ACCESS(代码 = EXC_I386_GPFLT),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22731818/
我是一名优秀的程序员,十分优秀!