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 908 forks source link

ERROR RUNNING ON XCODE 12 #794

Open delcerrocristian opened 4 years ago

delcerrocristian commented 4 years ago

ERROR

Undefined symbols for architecture x86_64:
  "__swift_FORCE_LOAD_$_swiftUniformTypeIdentifiers", referenced from:
      __swift_FORCE_LOAD_$_swiftUniformTypeIdentifiers_$_FBSDKShareKit in libFBSDKShareKit.a(Enums+Extensions.o)
     (maybe you meant: __swift_FORCE_LOAD_$_swiftUniformTypeIdentifiers_$_FBSDKShareKit)
  "__swift_FORCE_LOAD_$_swiftCoreMIDI", referenced from:
      __swift_FORCE_LOAD_$_swiftCoreMIDI_$_FBSDKShareKit in libFBSDKShareKit.a(Enums+Extensions.o)
     (maybe you meant: __swift_FORCE_LOAD_$_swiftCoreMIDI_$_FBSDKShareKit)
  "__swift_FORCE_LOAD_$_swiftWebKit", referenced from:
      __swift_FORCE_LOAD_$_swiftWebKit_$_FBSDKCoreKit in libFBSDKCoreKit.a(AccessToken.o)
      __swift_FORCE_LOAD_$_swiftWebKit_$_FBSDKCoreKit in libFBSDKCoreKit.a(Permission.o)
      __swift_FORCE_LOAD_$_swiftWebKit_$_FBSDKCoreKit in libFBSDKCoreKit.a(Settings.o)
      __swift_FORCE_LOAD_$_swiftWebKit_$_FBSDKLoginKit in libFBSDKLoginKit.a(FBLoginButton.o)
      __swift_FORCE_LOAD_$_swiftWebKit_$_FBSDKLoginKit in libFBSDKLoginKit.a(LoginManager.o)
      __swift_FORCE_LOAD_$_swiftWebKit_$_FBSDKShareKit in libFBSDKShareKit.a(Enums+Extensions.o)
     (maybe you meant: __swift_FORCE_LOAD_$_swiftWebKit_$_FBSDKLoginKit, __swift_FORCE_LOAD_$_swiftWebKit_$_FBSDKShareKit , __swift_FORCE_LOAD_$_swiftWebKit_$_FBSDKCoreKit )
ld: symbol(s) not found for architecture x86_64

Environment

React Native Environment Info: OS: macOS 10.15.1 Binaries: Node: 12.0.0 - /usr/local/bin/node Yarn: 1.10.1 - /usr/local/bin/yarn npm: 6.9.0 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman react-native-cli: 2.0.1

PolGuixe commented 4 years ago

+1

joaom182 commented 4 years ago

@delcerrocristian have you tried to add an empty swift file on your project? When you add an empty swift file, XCode will ask you "Create Bridging Header".

It will include to the Header Search Path on your build settings:

$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)
$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)
ealmiladi commented 4 years ago

@delcerrocristian have you tried to add an empty swift file on your project? When you add an empty swift file, XCode will ask you "Create Bridging Header".

It will include to the Header Search Path on your build settings:

$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)
$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)

You're a legend.

delcerrocristian commented 4 years ago

@delcerrocristian have you tried to add an empty swift file on your project? When you add an empty swift file, XCode will ask you "Create Bridging Header".

It will include to the Header Search Path on your build settings:

$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)
$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)

This works for me! 👏

vertvvv commented 4 years ago

@delcerrocristian have you tried to add an empty swift file on your project? When you add an empty swift file, XCode will ask you "Create Bridging Header".

It will include to the Header Search Path on your build settings:

$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)
$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)

Big thanks! But be sure you didn't delete an empty file after creating, otherwise it doesn't work 🙂

fabriciosautner commented 4 years ago

@delcerrocristian você tentou adicionar um arquivo swift vazio ao seu projeto? Quando você adiciona um arquivo swift vazio, o XCode irá perguntar a você "Create Bridging Header".

Isso incluirá o Caminho de pesquisa do cabeçalho nas configurações de sua construção:

$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)
$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)

This works by also reminding you to add a new Swift file inside your APP folder.

jinsunee commented 4 years ago

@delcerrocristian 프로젝트에 빈 신속한 파일을 추가하려고 했습니까? 빈 swift 파일을 추가하면 XCode에서 "브리징 헤더 생성"을 요청합니다.

빌드 설정의 헤더 검색 경로에 포함됩니다.

$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)
$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)

You're a legend.

kanes115 commented 4 years ago

Where exactly should I create the file? In my react-native application root? And the try to build the app (with npx react-native run-ios)? Meanwhile building, it will prompt me something?

mmorcos commented 4 years ago

Where exactly should I create the file? In my react-native application root? And the try to build the app (with npx react-native run-ios)? Meanwhile building, it will prompt me something?

@kanes115 Open up the .xcworkspace xcode project in your ios/ folder. In xcode file -> new file -> swift. It'll prompt you

n3rd253 commented 3 years ago

@joaom182

Dude you saved my life.

anhquan291 commented 3 years ago

@delcerrocristian have you tried to add an empty swift file on your project? When you add an empty swift file, XCode will ask you "Create Bridging Header".

It will include to the Header Search Path on your build settings:

$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)
$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)

You saved my day ! thank a lot

zenara commented 3 years ago

@delcerrocristian have you tried to add an empty swift file on your project? When you add an empty swift file, XCode will ask you "Create Bridging Header".

It will include to the Header Search Path on your build settings:

$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)
$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)

Saved my day!

pharidali commented 3 years ago

@delcerrocristian have you tried to add an empty swift file on your project? When you add an empty swift file, XCode will ask you "Create Bridging Header".

It will include to the Header Search Path on your build settings:

$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)
$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)

Oh my God ! Thanks for your great help dude :)

bakkerjoeri commented 3 years ago

@delcerrocristian have you tried to add an empty swift file on your project? When you add an empty swift file, XCode will ask you "Create Bridging Header".

It will include to the Header Search Path on your build settings:

$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)
$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)

Well, that did the trick! Why does that fix this problem, though? I don't really understand how the error relates to the fix.

felire commented 3 years ago

It works for me! Thanks! But Can I delete the swift and the bridging file but maintaining the changes on the project file? Because they are empty files, it's really weird to have them on the project

ngnclht1102 commented 3 years ago

@delcerrocristian have you tried to add an empty swift file on your project? When you add an empty swift file, XCode will ask you "Create Bridging Header".

It will include to the Header Search Path on your build settings:

$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)
$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)

it works, but can someone explain why it works, please?

muhammadashfaq commented 3 years ago

@delcerrocristian have you tried to add an empty swift file on your project? When you add an empty swift file, XCode will ask you "Create Bridging Header".

It will include to the Header Search Path on your build settings:

$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)
$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)

awesome man. you are gem

moojin-woody-kim commented 3 years ago

@delcerrocristian have you tried to add an empty swift file on your project? When you add an empty swift file, XCode will ask you "Create Bridging Header".

It will include to the Header Search Path on your build settings:

$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)
$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)

you're king god general choong-moo-gong

anees17861 commented 3 years ago

Can someone tell me how to fix it on the library side. I'm developing a xcframework library. I am using Xcode 11.5 to build it while my client has 12.2. Should I update myself to 12.2 as well and build again? If yes, do I need to release a new XCFramework for every Xcode update?

AmanSafeer commented 3 years ago

@delcerrocristian have you tried to add an empty swift file on your project? When you add an empty swift file, XCode will ask you "Create Bridging Header".

It will include to the Header Search Path on your build settings:

$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)
$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)

Thanks 👍

gujarnitesh8 commented 3 years ago

@delcerrocristian have you tried to add an empty swift file on your project? When you add an empty swift file, XCode will ask you "Create Bridging Header".

It will include to the Header Search Path on your build settings:

$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)
$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)

Thanks brother 👍

juangabrieldev commented 3 years ago

@delcerrocristian have you tried to add an empty swift file on your project? When you add an empty swift file, XCode will ask you "Create Bridging Header".

It will include to the Header Search Path on your build settings:

$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)
$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)

Having the same problem. This worked for me 💯

ghafartanveer commented 3 years ago

https://github.com/facebook/react-native-fbsdk/issues/794#issuecomment-695217977

You saved my day! thank a lot

hakkikonu commented 3 years ago

After facebook-ios-sdk v7 you need to create a swift file into the main project folder

File.swift

prescindivel commented 3 years ago

@delcerrocristian have you tried to add an empty swift file on your project? When you add an empty swift file, XCode will ask you "Create Bridging Header".

It will include to the Header Search Path on your build settings:

$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)
$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)

This worked for me!!!!

JZorina commented 3 years ago

@delcerrocristian have you tried to add an empty swift file on your project? When you add an empty swift file, XCode will ask you "Create Bridging Header".

It will include to the Header Search Path on your build settings:

$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)
$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)

THANKS KAPARA ON YOU!!

mehdinourollah commented 3 years ago

@delcerrocristian have you tried to add an empty swift file on your project? When you add an empty swift file, XCode will ask you "Create Bridging Header". It will include to the Header Search Path on your build settings:

$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)
$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)

THANKS KAPARA ON YOU!!

Thank you !!! You don't know how much time I spent on this !!!! Can anyone explain ?