facebookarchive / react-native-fbsdk

A React Native wrapper around the Facebook SDKs for Android and iOS. Provides access to Facebook login, sharing, graph requests, app events etc.
https://developers.facebook.com/docs/react-native
Other
2.99k stars 909 forks source link

Build failed with duplicate symbols error #761

Closed Dimatymoshchenko closed 4 years ago

Dimatymoshchenko commented 4 years ago

Hello there, i have a problem, hope u help me.

🐛 Bug Report

Following the installation guide step by step during the build I get an error "duplicate symbols....". How to fix it?

Code Example

duplicate symbol '_OBJC_CLASS_$_FBSDKSendButton' in:
    /Users/dirkraft/Library/Developer/Xcode/DerivedData/omgthnx-ahwoojmsvcfpcaezqpotmdsjbniv/Build/Products/Debug-iphonesimulator/FBSDKShareKit/libFBSDKShareKit.a(FBSDKSendButton.o)
    /Users/dirkraft/Documents/FacebookSDK/FBSDKShareKit.framework/FBSDKShareKit(FBSDKSendButton.o)
duplicate symbol '_OBJC_METACLASS_$_FBSDKSendButton' in:
    /Users/dirkraft/Library/Developer/Xcode/DerivedData/omgthnx-ahwoojmsvcfpcaezqpotmdsjbniv/Build/Products/Debug-iphonesimulator/FBSDKShareKit/libFBSDKShareKit.a(FBSDKSendButton.o)
    /Users/dirkraft/Documents/FacebookSDK/FBSDKShareKit.framework/FBSDKShareKit(FBSDKSendButton.o)
duplicate symbol '_OBJC_IVAR_$_FBSDKSendButton._dialog' in:
    /Users/dirkraft/Library/Developer/Xcode/DerivedData/omgthnx-ahwoojmsvcfpcaezqpotmdsjbniv/Build/Products/Debug-iphonesimulator/FBSDKShareKit/libFBSDKShareKit.a(FBSDKSendButton.o)
    /Users/dirkraft/Documents/FacebookSDK/FBSDKShareKit.framework/FBSDKShareKit(FBSDKSendButton.o)
duplicate symbol '_OBJC_CLASS_$_FBSDKLikeBoxView' in:
    /Users/dirkraft/Library/Developer/Xcode/DerivedData/omgthnx-ahwoojmsvcfpcaezqpotmdsjbniv/Build/Products/Debug-iphonesimulator/FBSDKShareKit/libFBSDKShareKit.a(FBSDKLikeBoxView.o)
    /Users/dirkraft/Documents/FacebookSDK/FBSDKShareKit.framework/FBSDKShareKit(FBSDKLikeBoxView.o)
duplicate symbol '_OBJC_METACLASS_$_FBSDKLikeBoxView' in:
    /Users/dirkraft/Library/Developer/Xcode/DerivedData/omgthnx-ahwoojmsvcfpcaezqpotmdsjbniv/Build/Products/Debug-iphonesimulator/FBSDKShareKit/libFBSDKShareKit.a(FBSDKLikeBoxView.o)
    /Users/dirkraft/Documents/FacebookSDK/FBSDKShareKit.framework/FBSDKShareKit(FBSDKLikeBoxView.o)
duplicate symbol '_OBJC_IVAR_$_FBSDKLikeBoxView._borderView' in:
    /Users/dirkraft/Library/Developer/Xcode/DerivedData/omgthnx-ahwoojmsvcfpcaezqpotmdsjbniv/Build/Products/Debug-iphonesimulator/FBSDKShareKit/libFBSDKShareKit.a(FBSDKLikeBoxView.o)
    /Users/dirkraft/Documents/FacebookSDK/FBSDKShareKit.framework/FBSDKShareKit(FBSDKLikeBoxView.o)
duplicate symbol '_OBJC_IVAR_$_FBSDKLikeBoxView._caretPosition' in:
    /Users/dirkraft/Library/Developer/Xcode/DerivedData/omgthnx-ahwoojmsvcfpcaezqpotmdsjbniv/Build/Products/Debug-iphonesimulator/FBSDKShareKit/libFBSDKShareKit.a(FBSDKLikeBoxView.o)
    /Users/dirkraft/Documents/FacebookSDK/FBSDKShareKit.framework/FBSDKShareKit(FBSDKLikeBoxView.o)
duplicate symbol '_OBJC_IVAR_$_FBSDKLikeBoxView._likeCountLabel' in:

Environment

System: OS: macOS 10.15.4 CPU: (8) x64 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz Memory: 19.59 MB / 8.00 GB Shell: 5.7.1 - /bin/zsh Binaries: Node: 10.15.3 - /usr/local/bin/node Yarn: 1.17.3 - /usr/local/bin/yarn npm: 6.14.4 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman Managers: CocoaPods: 1.9.1 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: iOS 13.5, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2 Android SDK: Not Found IDEs: Android Studio: 4.0 AI-193.6911.18.40.6514223 Xcode: 11.5/11E608c - /usr/bin/xcodebuild Languages: Java: 12.0.1 - /usr/bin/javac Python: 2.7.16 - /usr/bin/python npmPackages: @react-native-community/cli: Not Found react: 16.11.0 => 16.11.0 react-native: 0.62.2 => 0.62.2

anhhtz commented 4 years ago

Tell me the way to fix that. Thanks !

heidji commented 3 years ago

@anhhtz doesn't seem like he's interested in helping anyone. have you found anything in the meantime? :D

heidji commented 3 years ago

I believe the docs are wrong with "drag the SDK files into the project". it seems that Pods already do that for you

wallycarvalho commented 3 years ago

I believe the docs are wrong with "drag the SDK files into the project". it seems that Pods already do that for you

Ok. So does that mean, if you pod install - by mistake, you should maybe remove the framework you dragged? I noticed it was indeed added to cocoapods framework folder. If I find a solution or a set of steps, I will come back here.

heidji commented 3 years ago

I don't exactly remember but in the docs there was a step where is says you need to drag the SDK files into your project. this is completely false because if i rememebr correctly "pod install" does it for you automatically.

wallycarvalho commented 3 years ago

Alright, if anybody ran pod install by mistake (event after the warning stated before you started the quickstart tutorial) here is what worked for me:

Again, there is a big warning and if you didn't pod install and followed all the other steps... you should be fine.