试图仅将无用的Answers
框架用于OSX平台:
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)
最佳答案
那是因为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]]];
...
}
关于macos - Fabric回答OSX链接错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/34887387/