facebookarchive/react-native-fbsdk

ERROR RUNNING ON XCODE 12

delcerrocristian opened this issue ยท 27 comments

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

+1

@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)

@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 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! ๐Ÿ‘

@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 ๐Ÿ™‚

@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.

@delcerrocristian ํ”„๋กœ์ ํŠธ์— ๋นˆ ์‹ ์†ํ•œ ํŒŒ์ผ์„ ์ถ”๊ฐ€ํ•˜๋ ค๊ณ  ํ–ˆ์Šต๋‹ˆ๊นŒ?
๋นˆ swift ํŒŒ์ผ์„ ์ถ”๊ฐ€ํ•˜๋ฉด XCode์—์„œ "๋ธŒ๋ฆฌ์ง• ํ—ค๋” ์ƒ์„ฑ"์„ ์š”์ฒญํ•ฉ๋‹ˆ๋‹ค.

๋นŒ๋“œ ์„ค์ •์˜ ํ—ค๋” ๊ฒ€์ƒ‰ ๊ฒฝ๋กœ์— ํฌํ•จ๋ฉ๋‹ˆ๋‹ค.

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

You're a legend.

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?

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

@joaom182

Dude you saved my life.

@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

@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!

@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 :)

@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.

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

@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?

@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

@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

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?

@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 ๐Ÿ‘

@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 ๐Ÿ‘

@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 ๐Ÿ’ฏ

#794 (comment)

You saved my day! thank a lot

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

File.swift

@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!!!!

@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!!

@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 ?