Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LinkedIn SDK duplicate symbol

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?

like image 768
Rinat Avatar asked Jul 07 '15 01:07

Rinat


3 Answers

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.

like image 200
Peter Li Avatar answered Nov 18 '22 06:11

Peter Li


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.

like image 20
dce Avatar answered Nov 18 '22 05:11

dce


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
like image 3
Chandu kumar.Alasyam Avatar answered Nov 18 '22 05:11

Chandu kumar.Alasyam