内部AppDelegate didFinishLaunchingWithOptions:
#if DEBUG let buildFor = "DEV" #else let buildFor = "PROD" #endif let firebasePlistFileName = buildFor == "DEV" ? "GoogleService-Info-Dev" : "GoogleService-Info" let firebaSEOptions = FIROptions(contentsOfFile: NSBundle.mainBundle().pathForResource(firebasePlistFileName,ofType: "plist")) FIRApp.configureWithOptions(firebaSEOptions) // line causing new Firebase error
直到今天,当我遇到另一个Cocoapod项目的问题时,这一直很好.我认为当我清理Xcode项目或删除Derived Data文件夹时,它就开始发生了:
dyld: Library not loaded: @rpath/OtherPod.framework/OtherPod Referenced from: /Users/me/Library/Developer/CoreSimulator/Devices/12345678-E1C4-480F-B1D9-C10823DEA810/data/Containers/Bundle/Application/AE7B6EB0-43AB-CCCC-BBBB-AAAA71BF/MyApp.app/MyApp Reason: image not found
我最终通过选择目标下的应用程序解决了这个问题 – >一般 – >链接的框架和库,然后在Workspace文件夹(7个其他pod项目)中添加所有选项,并将我添加的那些选项设置为可选.从那时起,我一直面临着这篇文章标题中描述的错误:
2017-02-10 17:19:29.660 MyApp[12639:182433] +[NSData gtm_dataByGzippingData:error:]: unrecognized selector sent to class 0x10a0442e8 2017-02-10 17:19:29.680 MyApp[12639:182433] *** Terminating app due to uncaught exception 'NSInvalidArgumentException',reason: '+[NSData gtm_dataByGzippingData:error:]: unrecognized selector sent to class 0x10a0442e8' *** First throw call stack: ( 0 CoreFoundation 0x0000000109d88d4b __exceptionPreprocess + 171 1 libobjc.A.dylib 0x00000001097f121e objc_exception_throw + 48 2 CoreFoundation 0x0000000109df8e44 +[NSObject(NSObject) doesNotRecognizeSelector:] + 132 3 CoreFoundation 0x0000000109d0e005 ___forwarding___ + 1013 4 CoreFoundation 0x0000000109d0db88 _CF_forwarding_prep_0 + 120 5 MyApp 0x0000000102d73c9d -[FIRNetwork postURL:payload:queue:usingBackgroundSession:completionHandler:] + 331 6 MyApp 0x0000000102d70e72 -[FIRClearcutLogger sendNextPendingRequestWithCompletionHandler:] + 570 7 MyApp 0x0000000102d70918 -[FIRClearcutLogger sendLogsWithCompletionHandler:] + 447 8 libdispatch.dylib 0x000000010a6ab978 _dispatch_call_block_and_release + 12 9 libdispatch.dylib 0x000000010a6d50cd _dispatch_client_callout + 8 10 libdispatch.dylib 0x000000010a6b2e17 _dispatch_queue_serial_drain + 236 11 libdispatch.dylib 0x000000010a6b3b4b _dispatch_queue_invoke + 1073 12 libdispatch.dylib 0x000000010a6b402b _dispatch_queue_override_invoke + 683 13 libdispatch.dylib 0x000000010a6b6385 _dispatch_root_queue_drain + 720 14 libdispatch.dylib 0x000000010a6b6059 _dispatch_worker_thread3 + 123 15 libsystem_pthread.dylib 0x000000010aa3a712 _pthread_wqthread + 1299 16 libsystem_pthread.dylib 0x000000010aa3a1ed start_wqthread + 13 ) libc++abi.dylib: terminating with uncaught exception of type NSException
我尝试了很多不同的修复,包括adding to the Link Binary with Libraries,adding to the Other Linker Flags,但没有一个有效.
无法识别的选择器可能是什么,以及如何更改/删除它?这个问题可能是由于我面临的早期问题(库没有加载)吗?
为了澄清,当发送到类错误的无法识别的选择器发生时,Xcode调试导航器专注于线程7,FIRApp.configureWithOptions(firebaSEOptions)行被突出显示.
更新
我通过恢复到之前的git提交(将我的存储库克隆到一个单独的目录)找到了一个临时修复,然后用当前生成错误的副本替换了旧提交中的大部分项目内容,包括root中的App-Name文件夹目录,App-Name.xcodeproj和App-Name.xcworkspace.我只在模拟器(运行iOS 10.2的iPhone 7)上进行了测试,这很有效.然后我成功地向iTunes Connect提交了一个版本,并且能够在我的设备上运行该版本(带有10.2.1的iPhone 5c),但是在删除它并尝试从Xcode运行构建之后,我再次遇到了同样的错误.但是,在模拟器上运行时没有发生错误.这与在物理设备和模拟器上发生的初始错误情况形成对比.
这让我记得我最初发布的堆栈跟踪是在模拟器上运行应用程序的堆栈跟踪.在设备上运行产生的输出较少,特别是***之后的第一次调用堆栈:仅为(0x1d01cdf7 0x1c27f077 0x1d022467 0x1d020579 0x1cf453d8 0x31ff3f 0x31d653 0x31d05d 0x1c57d57 0x1c63e63 0x1c5b205 0x1c64391 0x1c65d9f 0x1c65ba7 0x1c877937 0x1c877490)而不是文件/更具描述性的输出功能名称.