7
votes

I downloaded latest LinkedIn SDK and added to my project but building failed

duplicate symbol _OBJC_METACLASS_$_PodsDummy_Pods in: /linkedin-sdk.framework/linkedin-sdk(Pods-dummy.o) /Build/Products/Debug-iphonesimulator/libPods.a(Pods-dummy.o) duplicate symbol _OBJC_CLASS_$_PodsDummy_Pods in: /linkedin-sdk.framework/linkedin-sdk(Pods-dummy.o) /Build/Products/Debug-iphonesimulator/libPods.a(Pods-dummy.o) ld: 2 duplicate symbols for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Does anyone know how to fix it?

3
Also here is discussion of this issue: github.com/CocoaPods/CocoaPods/issues/1767Vlad Papko
This solution solved the same problem for me: stackoverflow.com/a/30722343/3820161dce
@dce do you mean that I should rename all symbols of pod libraries to solve problem. I guess LinkedIn developers should fix itRinat
yeah +1 for @Rinat comment. Why should I change all of my other pods. Such a bad bug for a very late coming library. Haven't they test this case?mkeremkeskin

3 Answers

24
votes

I had the same issue, and found a workaround until the LinkedIn SDK is 'fixed'.

Simply update the Pods-dummy.m file in the Pods Xcode project from:

#import <Foundation/Foundation.h>
@interface PodsDummy_Pods : NSObject
@end
@implementation PodsDummy_Pods
@end

to

#import <Foundation/Foundation.h>
@interface PodsDummy_Podsxx : NSObject
@end
@implementation PodsDummy_Podsxx
@end

and it will then link.

Note: you will need to patch this each time you update your Pods via the command line, e.g. "pod install" or update etc.

3
votes

I can't comment so I will leave this as a reply to @rinat , I didn't need to change the other pods name, just add:

post_install do |installer_representation|
    installer_representation.project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] =     '$(inherited), PodsDummy_Pods=SomeOtherNamePodsDummy_Pods'
        end
    end
end

to the pod file. Anyways the SDK linkedIn didn't work at all for me. I haven't been able to make it work, it simply doesn't work when authenticating with the app ready. No logs, nothing... I ended implementing a normal OAuth2 web login.

3
votes

Hey no need to change PodsDummy_Pods name to PodsDummy_Podsxx each time you update your Pods via the command line, e.g. "pod install" or update etc.

Paste below code in Podfile. linkedIn SDK working cool......

post_install do |installer_representation|
    installer_representation.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited), PodsDummy_Pods=SomeOtherNamePodsDummy_Pods'
        end
    end
end