试图在OSX平台上使用annonced Answers
框架:
pod 'Fabric'
pod 'Answers'
pod 'Crashlytics'
#import <Fabric/Fabric.h>
#import <Answers/Answers.h>
#import <Crashlytics/Crashlytics.h>
[Fabric with:@[[Crashlytics class], [Answers class]]];
并且出现了错误:
...
duplicate symbol _OBJC_METACLASS_$_CLSAnswersInviteEvent in:
/Users/k06a/Projects/UXMaterial/Pods/Answers/OSX/Answers.framework/Answers(CLSAnswersInviteEvent.o)
/Users/k06a/Projects/UXMaterial/Pods/Crashlytics/OSX/Crashlytics.framework/Crashlytics(CLSAnswersInviteEvent.o)
ld: 200 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
答案 0 :(得分:16)
这是因为Crashlytics
框架本身已包含Answers
框架。你只需要这样做:
Podfile:
pod 'Fabric'
pod 'Crashlytics'
你的AppDelegate.m:
#import <Fabric/Fabric.h>
#import <Crashlytics/Answers.h>
#import <Crashlytics/Crashlytics.h>
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
...
[Fabric with:@[[Crashlytics class], [Answers class]]];
...
}