简体   繁体   English

切换到Debug时,体系结构x86_64的未定义符号

[英]Undefined symbols for architecture x86_64 when switching to Debug

I get the following error, when I switch the scheme to Debug. 当我将方案切换到Debug时,我收到以下错误。 In Release I can build without any problems. 在Release中我可以毫无问题地构建。

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_RCTReconnectingWebSocket", referenced from:
      objc-class-ref in libReact.a(RCTPackagerConnection.o)
  "_OBJC_CLASS_$_RCTSRWebSocket", referenced from:
      objc-class-ref in libReact.a(RCTInspectorPackagerConnection.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Pod File: Pod文件:

target "xy" do
  pod 'React', :path => '../node_modules/react-native', :subspecs => [
    'Core',
    'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43
    'CxxBridge' # Include if RN >= 0.47
  ]
  pod 'DoubleConversion', podspec: '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'Folly', podspec: '../node_modules/react-native/third-party-podspecs/Folly.podspec'
  pod 'GLog', podspec: '../node_modules/react-native/third-party-podspecs/GLog.podspec'


  pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
  pod 'Firebase/Core'
  pod 'GoogleToolboxForMac/NSData+zlib'
  pod 'CodePush', :path => '../node_modules/react-native-code-push'
  pod 'react-native-fetch-blob', :path => '../node_modules/react-native-fetch-blob'
  pod 'RNShare', :path => '../node_modules/react-native-share'
  pod 'react-native-fbsdk', :path => '../node_modules/react-native-fbsdk/ios'
  pod 'react-native-splash-screen', :path => '../node_modules/react-native-splash-screen'

end

You can try to add it to your pod 'React' section like this: 你可以尝试将它添加到你的pod 'React'部分,如下所示:

  pod 'React', :path => '../node_modules/react-native', :subspecs => [
    'Core',
    'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43
    'CxxBridge',
    'RCTWebSocket'
 ]

Don't forget to run pod install . 不要忘记运行pod install

If this doesn't work: 如果这不起作用:

  • open XCode, 打开XCode,
  • click to your Project-Root 单击您的Project-Root
  • choose your Target 选择你的目标
  • Tab: Build Phases 标签:构建阶段
  • Link Binary with Libraries 链接二进制文件与库
  • Press the + (on the buttom of this Section) and + (在本节的底部)和
  • add libRCTWebsocket.a 添加libRCTWebsocket.a

This should fix it. 这应该解决它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM