react-native-fbads icon indicating copy to clipboard operation
react-native-fbads copied to clipboard

51 duplicate symbols for architecture x86_64

Open chaudharyvikram opened this issue 3 years ago • 5 comments

Ad Modules

-Banner Ads -Interstitial Ads

Platforms

-iOS

Versions

  • react-native-fbads: 7.0.5
  • react-native: 0.62.2

Issue

When we try to install pod after installing npm package of Facebook ads, There are three pods are installing.

  • Installing FBAudienceNetwork (6.5.1)
  • Installing FBSDKCoreKit_Basics (11.0.1)
  • Installing ReactNativeAdsFacebook (7.0.5)

After this we try to run our app and it throws error in FBSDKUtility and SessionProvider in FBSDKCoreKit_Basics Pod folder. after importing appropriate packages for error, we tried to run again our app. But At build time FBSDKCoreKit_Basics conflicts with FBSDKCoreKit which is installed for Facebook login functionality.

  • Why FBSDKCoreKit_Basics is needs to b installed with FBAudienceNetwork when the same code and functionality already available in FBSDKCoreKit SDK? Due to this conflict and duplicate pods we can not able to ad Facebook ads in our application.

Screenshot 2021-06-29 at 6 08 10 PM

Steps to generate issue

  • Create new React-Native project using "expo init [Project-Name]" Command
  • Install Package For Facebook Login using "npm install --save react-native-fbsdk" Command
  • Install Package For Facebook Audience Network using "npm install --save react-native-fbads" Command
  • Install Pods for above commands using "cd ios && pod install" Command
  • Run the project using "npm run ios" command. Build will fails due to "Cannot find protocol declaration for 'FBSDKSessionProviding'" See Attached ScreenShot below:

Screenshot 2021-06-29 at 5 58 03 PM

  • Fix above issue by importing "FBSDKSessionProviding.h" header file.
  • Now You may see another errors like in Below ScreenShot

Screenshot 2021-06-29 at 6 01 09 PM

  • Fix above error by removing below imports #import "FBSDKBasicUtility.h" #import "FBSDKTypeUtility.h"

and add below line after removing above code #import <FBSDKCoreKit_Basics/FBSDKCoreKit_Basics.h>

  • Run Project again in iOS
  • Now You can see main error which conflict the Both SDK. Error: 51 duplicate symbols for architecture x86_64 See First ScreenShot.

Please look into this asap. We tried almost all solution available in google search.

Thank You

chaudharyvikram avatar Jun 29 '21 12:06 chaudharyvikram

The same error seems to occur

Packages info:

    "react": "17.0.1",
    "react-native": "^0.64.2",
    "react-native-fbads": "^7.0.5",
    "react-native-fbsdk-next": "^4.3.0",

Error Thrown

duplicate symbol '_FBSDKAppEventPhone' in:
    /Users/sagar/Library/Developer/Xcode/DerivedData/superapp-cfatsrwpxtvtdwfboqdkuquttydf/Build/Products/Debug-iphonesimulator/FBSDKCoreKit/libFBSDKCoreKit.a(FBSDKUserDataStore.o)
    /Users/sagar/Library/Developer/Xcode/DerivedData/mySuperApp-cfatsrwpxtvtdwfboqdkuquttydf/Build/Products/Debug-iphonesimulator/FBSDKCoreKit_Basics/libFBSDKCoreKit_Basics.a(FBSDKUserDataStore.o)
duplicate symbol '_FBSDKAppEventFirstName' in:
    /Users/sagar/Library/Developer/Xcode/DerivedData/superapp-cfatsrwpxtvtdwfboqdkuquttydf/Build/Products/Debug-iphonesimulator/FBSDKCoreKit/libFBSDKCoreKit.a(FBSDKUserDataStore.o)
    /Users/sagar/Library/Developer/Xcode/DerivedData/elliel-cfatsrwpxtvtdwfboqdkuquttydf/Build/Products/Debug-iphonesimulator/FBSDKCoreKit_Basics/libFBSDKCoreKit_Basics.a(FBSDKUserDataStore.o)
duplicate symbol '_FBSDKAppEventLastName' in:
    /Users/sagar/Library/Developer/Xcode/DerivedData/superapp-cfatsrwpxtvtdwfboqdkuquttydf/Build/Products/Debug-iphonesimulator/FBSDKCoreKit/libFBSDKCoreKit.a(FBSDKUserDataStore.o)
    /Users/sagar/Library/Developer/Xcode/DerivedData/superapp-cfatsrwpxtvtdwfboqdkuquttydf/Build/Products/Debug-iphonesimulator/FBSDKCoreKit_Basics/libFBSDKCoreKit_Basics.a(FBSDKUserDataStore.o)
duplicate symbol '_FBSDKAppEventExternalId' in:
    /Users/sagar/Library/Developer/Xcode/DerivedData/superapp-cfatsrwpxtvtdwfboqdkuquttydf/Build/Products/Debug-iphonesimulator/FBSDKCoreKit/libFBSDKCoreKit.a(FBSDKUserDataStore.o)
    /Users/sagar/Library/Developer/Xcode/DerivedData/superapp-cfatsrwpxtvtdwfboqdkuquttydf/Build/Products/Debug-iphonesimulator/FBSDKCoreKit_Basics/libFBSDKCoreKit_Basics.a(FBSDKUserDataStore.o)
ld: 58 duplicate symbols for architecture x86_64

teamseamive avatar Jul 06 '21 10:07 teamseamive

Use FBAudienceNetwork 6.4.1 instead as a workaround or updates Facebook SDK to the latest version.

tmjordan avatar Jul 07 '21 07:07 tmjordan

@tmjordan Yes, 6.4.1 SDK is working fine. we also used this version.

chaudharyvikram avatar Jul 08 '21 20:07 chaudharyvikram

@tmjordan How I Can Change FBAudienceNetwork6.4.1? which file i have to change ?

SafiDS avatar Jul 27 '21 18:07 SafiDS

@SafiDS add this line in your podfile

pod 'FBAudienceNetwork', '~> 6.4.1'

tmjordan avatar Jul 31 '21 00:07 tmjordan