【发布时间】:2017-03-14 21:26:07
【问题描述】:
我有一个 iOS 项目,其中包括 Firebase 和 Google Toolbox For Mac(通过 Pods):
target 'MyApp' do
pod 'GoogleToolboxForMac', '~> 2.1'
pod 'GTMSessionFetcher', '~> 1.1'
pod 'gtm-logger', '~> 0.0.5'
pod 'Firebase/Core'
pod 'Firebase/Auth'
pod 'Firebase/Database'
pod 'Firebase/Messaging'
end
在 AppDelegate 中配置:
@implementation AppDelegate
-(instancetype)init {
self = [super init];
[FIRApp configure];
return self;
}
当我运行项目时,我得到这个错误:
<FIRMessaging/INFO> FIRMessaging library version 1.2.2
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSData gtm_dataByGzippingData:error:]: unrecognized selector sent to class 0x10a548e88'
*** First throw call stack:
(
0 CoreFoundation 0x000000010a326f65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000109da0deb objc_exception_throw + 48
2 CoreFoundation 0x000000010a32f48d +[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x000000010a27cf7a ___forwarding___ + 970
4 CoreFoundation 0x000000010a27cb28 _CF_forwarding_prep_0 + 120
5 MyApp 0x0000000107115ec1 -[FIRNetwork postURL:payload:queue:usingBackgroundSession:completionHandler:] + 331
6 MyApp 0x000000010710b053 -[FIRClearcutLogger sendNextPendingRequestWithCompletionHandler:] + 570
7 MyApp 0x000000010710aaf9 -[FIRClearcutLogger sendLogsWithCompletionHandler:] + 447
8 libdispatch.dylib 0x000000010a9edef9 _dispatch_call_block_and_release + 12
9 libdispatch.dylib 0x000000010aa0e49b _dispatch_client_callout + 8
10 libdispatch.dylib 0x000000010a9f4988 _dispatch_queue_drain + 2215
11 libdispatch.dylib 0x000000010a9f3ea9 _dispatch_queue_invoke + 601
12 libdispatch.dylib 0x000000010a9f6af2 _dispatch_root_queue_drain + 1420
13 libdispatch.dylib 0x000000010a9f6561 _dispatch_worker_thread3 + 111
14 libsystem_pthread.dylib 0x000000010ad3f712 _pthread_wqthread + 1299
15 libsystem_pthread.dylib 0x000000010ad3f1ed start_wqthread + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
根据其他答案,我在我的项目和目标的Other Linker Flags 中设置了-ObjC,但我仍然收到此错误。
谁能给点建议?
【问题讨论】:
标签: ios objective-c firebase cocoapods