繁体   English   中英

在 Xcode 13 中找不到架构 x86_64 的符号

[英]Symbol(s) not found for architecture x86_64 in Xcode 13

目前,我正在将 firebase 云消息服务集成到 react 本机移动应用程序中。 我按照他们关于 firebase 集成的文档进行了操作,并编辑了 pod 文件以使用框架。

使用框架时。 我收到关于传递依赖的错误。 这就是为什么我必须添加pre install do$static_framework

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '11.0'

$RNFirebaseAsStaticFramework = true
target 'P2PMobileApp' do
  use_frameworks!

  $static_framework = ['FlipperKit', 'Flipper', 'Flipper-Folly', 'CocoaAsyncSocket', 'ComponentKit', 'DoubleConversion', 'glog', 'Flipper-PeerTalk', 'Flipper-RSocket', 'Yoga', 'YogaKit', 'CocoaLibEvent', 'OpenSSL-Universal', 'boost-for-react-native']

  pre_install do |installer|
    Pod::Installer::Xcode::TargetValidator.send(:define_method,:verify_no_static_framework_transitive_dependencies) {}
    installer.pod_targets.each do |pod|
      if $static_framework.include?(pod.name)
        def pod.build_type;
          Pod::BuildType.static_library
        end
      end
    end
  end
  config = use_native_modules!

  use_react_native!(
    :path => config[:reactNativePath],
    # to enable hermes on iOS, change `false` to `true` and then install pods
    :hermes_enabled => false
  )

  pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'

  target 'P2PMobileAppTests' do
    inherit! :complete
    # Pods for testing
  end

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable the next line.
  # use_flipper!()

  post_install do |installer|
    react_native_post_install(installer)
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
  end
end

现在,当我尝试使用react-native run-ios运行应用程序时出现以下错误

Undefined symbols for architecture x84_64:
  "google::LogMessage::LogMessage(char const*, int, int)", referenced from:
    __react_native_log_default in react_native_log.o
  "google::LogMessageFatal::LogMessageFatal()", referenced from:
    __react_native_log_default in react_native_log.o
...

注意:我已经使用arch -x86_64 pod install完成了我的 pod 安装,因为我正在使用带有 M1 芯片的 mac mini。

我尝试使用以下解决方案解决该问题。 但他们都没有成功

  • 使用 xcode 链接二进制文件
  • 改变架构
  • 更改 pod 安装的架构(然后我得到与 arm64 相关的相同问题)
  • $static_framwork变量中删除glog (然后Undefined symbols for architecture x84_64:双转换模块出现问题)

我仍然坚持构建失败。 对此的任何帮助将不胜感激。

如果您使用的是 M1 芯片,则可以通过以下步骤解决:

Go 应用程序 > 右键单击 Xcode > 获取信息 > select 打开使用 Rosetta 重新启动系统

在此处输入图像描述

另一个解决方案可以是添加库

您可以通过以下方式添加它:

  • 单击左窗格左上角的项目(蓝色图标)。
  • 在中间窗格中,单击 Build Phases 选项卡。
  • 在“将二进制文件与库链接”下,单击加号按钮。
  • 从列表中找到 YOUR_FRAMEFOERK.framework 并点击添加。

暂无
暂无

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

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