LinkedIn SDK duplicate symbol
Asked Answered
N

3

7

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?

Nebiim answered 7/7, 2015 at 1:29 Comment(6)
possible duplicate of Prevent duplicate symbols when building static library with CocoapodsDiscommode
Also here is discussion of this issue: github.com/CocoaPods/CocoaPods/issues/1767Discommode
This solution solved the same problem for me: https://mcmap.net/q/576804/-prevent-duplicate-symbols-when-building-static-library-with-cocoapodsHochman
@Hochman do you mean that I should rename all symbols of pod libraries to solve problem. I guess LinkedIn developers should fix itNebiim
yeah +1 for @Nebiim 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?Sining
@keremkeskin do you know how to report bug to LinkedIn developers? I couldn't findNebiim
E
24

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.

Ern answered 16/8, 2015 at 12:48 Comment(2)
This is awesome.. simple fix and it worked like a charm...Thanks dude..!!Sphagnum
@Peter Li, Amazing hack dude! :)Multipurpose
H
3

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.

Hochman answered 13/7, 2015 at 5:29 Comment(0)
I
3

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
Inquisitor answered 20/1, 2016 at 13:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.