Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/106.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xcode/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 切换到调试时架构x86_64的未定义符号_Ios_Xcode_React Native_Cocoapods - Fatal编程技术网

Ios 切换到调试时架构x86_64的未定义符号

Ios 切换到调试时架构x86_64的未定义符号,ios,xcode,react-native,cocoapods,Ios,Xcode,React Native,Cocoapods,当我将方案切换到Debug时,出现以下错误。在发行版中,我可以毫无问题地构建 Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_RCTReconnectingWebSocket", referenced from: objc-class-ref in libReact.a(RCTPackagerConnection.o) "_OBJC_CLASS_$_RCTSRWebSocket", referenced fr

当我将方案切换到Debug时,出现以下错误。在发行版中,我可以毫无问题地构建

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文件:

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

您可以尝试将其添加到
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'
 ]
不要忘记运行
pod安装

如果这不起作用:

  • 开放XCode
  • 单击以创建项目根目录
  • 选择你的目标
  • 选项卡:构建阶段
  • 将二进制文件链接到库
  • +
    (本节按钮上)并
  • 添加
    libRCTWebsocket.a
这应该可以解决它