react-native - 安装 react-native-fbsdk 后无法找到或使用自动链接库 '..."

标签 react-native fbsdk

我正在尝试通过 npm 安装 react-native-fbsdk,虽然我的构建之前运行良好,但一旦我安装了库并安装了 pod,我就会收到以下错误:

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

我到处搜索这个问题的解决方案,但我没有看到如何解决这个库问题。

我在 React Native .60.5 上 - 这个问题有什么解决方案吗?

最佳答案

要解决此问题,您只需添加 快速文件 和 ** 在您的 Xcode 项目中“创建桥接头”**。

  • 打开 Xcode,在你的项目下选择 New file 并选择 快速文件
  • 现在清理您的构建并进行新构建。

  • 或者你可以看到下面的链接来很好地理解这一点
    Why linker link static libraries with errors? iOS

    关于react-native - 安装 react-native-fbsdk 后无法找到或使用自动链接库 '...",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61992533/

    相关文章:

    react-native - 如何在 React Native Expo 中访问相机?

    ios - JUCE 和 React Native - 链接器错误 "ld: library not found for -lReact"

    javascript - React Native Scrollview 停止动力? (世博会)

    ios - 使用 iOS FBSDK v4 (multipart/form-data) 上传到 facebook 时编码视频的正确方法

    ios - undefined symbol : _OBJC_CLASS_$_FBSDKBasicUtility

    ios - React native 套接字未在发布版本(IOS)中初始化

    ios - Swift FBSDK 问题 - 某些用户的 Facebook ID 为零

    ios - Facebook 登录完成 block 未调用

    swift - 使用 Swift 登录 FB

    react-native - 对象作为 React 子对象无效