Could not find or use auto-linked library '..." after installing react-native-fbsdk
Asked Answered
S

2

8

I am trying to install react-native-fbsdk via npm, and whereas my build worked perfectly before, once I install the library and install pods, I get the following error:

ld: warning: Could not find or use auto-linked library 'swiftCoreFoundation'
ld: warning: Could not find or use auto-linked library 'swiftCompatibility50'
ld: warning: Could not find or use auto-linked library 'swiftObjectiveC'
ld: warning: Could not find or use auto-linked library 'swiftFoundation'
ld: warning: Could not find or use auto-linked library 'swiftsimd'
ld: warning: Could not find or use auto-linked library 'swiftDarwin'
ld: warning: Could not find or use auto-linked library 'swiftUIKit'
ld: warning: Could not find or use auto-linked library 'swiftCore'
ld: warning: Could not find or use auto-linked library 'swiftQuartzCore'
ld: warning: Could not find or use auto-linked library 'swiftCoreGraphics'
ld: warning: Could not find or use auto-linked library 'swiftPhotos'
ld: warning: Could not find or use auto-linked library 'swiftSwiftOnoneSupport'
ld: warning: Could not find or use auto-linked library 'swiftCoreImage'
ld: warning: Could not find or use auto-linked library 'swiftCompatibilityDynamicReplacements'
ld: warning: Could not find or use auto-linked library 'swiftMetal'
ld: warning: Could not find or use auto-linked library 'swiftDispatch'
ld: warning: Could not find or use auto-linked library 'swiftAVFoundation'
ld: warning: Could not find or use auto-linked library 'swiftCoreMedia'
ld: warning: Could not find or use auto-linked library 'swiftCoreAudio'
ld: warning: Could not find or use auto-linked library 'swiftCoreMIDI'
ld: warning: Could not find or use auto-linked library 'swiftCoreLocation'
Undefined symbols for architecture x86_64:
  "protocol descriptor for Foundation.CustomNSError", referenced from:
      protocol conformance descriptor for __C_Synthesized.related decl 'e' for FBSDKLoginError : Foundation.CustomNSError in __C_Synthesized in libFBSDKLoginKit.a(LoginManager.o)
  "method descriptor for static Foundation.CustomNSError.errorDomain.getter : Swift.String", referenced from:
      protocol conformance descriptor for __C_Synthesized.related decl 'e' for FBSDKLoginError : Foundation.CustomNSError in __C_Synthesized in libFBSDKLoginKit.a(LoginManager.o)
  "method descriptor for Foundation.CustomNSError.errorUserInfo.getter : [Swift.String : Any]", referenced from:
      protocol conformance descriptor for __C_Synthesized.related decl 'e' for FBSDKLoginError : Foundation.CustomNSError in __C_Synthesized in libFBSDKLoginKit.a(LoginManager.o)
  "method descriptor for Foundation.CustomNSError.errorCode.getter : Swift.Int", referenced from:
      protocol conformance descriptor for __C_Synthesized.related decl 'e' for FBSDKLoginError : Foundation.CustomNSError in __C_Synthesized in libFBSDKLoginKit.a(LoginManager.o)
  "base conformance descriptor for Foundation.CustomNSError: Swift.Error", referenced from:
      protocol conformance descriptor for __C_Synthesized.related decl 'e' for FBSDKLoginError : Foundation.CustomNSError in __C_Synthesized in libFBSDKLoginKit.a(LoginManager.o)
  "protocol descriptor for Foundation._ErrorCodeProtocol", referenced from:

... etc

I've searched everywhere for a solution to this problem and I am not seeing how to solve this library issue.

I am on React Native .60.5 - is there any solution for this problem?

Sanders answered 24/5, 2020 at 21:16 Comment(3)
Which React-Native version does the FBSDK version you installed support? You may need to either downgrade FBSDK or upgrade RN.Conservationist
It have same problem on github, but there are no answer now.Erudition
Temporarily downgrading to v1.1.2 of react-native-fbsdk and 5.8.0 of fbsdk has solved the issueSanders
S
4

To resolve this problem you just need to add swift file and ** "Create Bridging Header"** in your Xcode project.

  • open Xcode and under you project select New file and select swift file
  • now clean your build and make new build.

Or you can see bellow link to understand this so well

Why linker link static libraries with errors? iOS

Sextuplicate answered 13/4, 2021 at 9:41 Comment(0)
C
3

I fixed this by adding a .swift file via xcode

  1. open XCode project
  2. create new file, select swift file
  3. confirm "Create Bridging Header"
  4. clean
  5. build

I tried a few combinations of these steps but found I needed all of them (ie. it must be done via xcode, you do need the bridging header, and you do need to clean the build folder).

Carolecarolee answered 5/11, 2020 at 15:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.