在 iOS 上使用 Hermes 时出现 RCT-Folly 错误

2023-12-14

在 Podfile 中启用 Hermes 并重建构建时,由于 RCT-Folly,它会失败。不知道它有什么作用。

要重新初始化所有内容,我使用以下命令:

rm -rf node_modules && rm package-lock.json && npm install && cd ios && rm -rf Pods && rm Podfile.lock && pod deintegrate && pod setup && pod install && cd ..

我还启动了 Metro 捆绑器:

npx react-native --reset-cache

有人有解决办法吗?

该应用程序使用react-native v0.64,我们希望使用hermes有更好的性能。

所有信息:

ios/Podfile

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

target 'unblnd' do
  config = use_native_modules!
  use_react_native!(
    :path => config[:reactNativePath],
    :hermes_enabled => true
  )

  permissions_path = '../node_modules/react-native-permissions/ios'
  pod 'Permission-BluetoothPeripheral', :path => "#{permissions_path}/BluetoothPeripheral"
  pod 'Permission-Calendars', :path => "#{permissions_path}/Calendars"
  pod 'Permission-Camera', :path => "#{permissions_path}/Camera"
  pod 'Permission-Contacts', :path => "#{permissions_path}/Contacts"
  pod 'Permission-FaceID', :path => "#{permissions_path}/FaceID"
  pod 'Permission-LocationAlways', :path => "#{permissions_path}/LocationAlways"
  pod 'Permission-LocationWhenInUse', :path => "#{permissions_path}/LocationWhenInUse"
  pod 'Permission-MediaLibrary', :path => "#{permissions_path}/MediaLibrary"
  pod 'Permission-Microphone', :path => "#{permissions_path}/Microphone"
  pod 'Permission-Motion', :path => "#{permissions_path}/Motion"
  pod 'Permission-Notifications', :path => "#{permissions_path}/Notifications"
  pod 'Permission-PhotoLibrary', :path => "#{permissions_path}/PhotoLibrary"
  pod 'Permission-Reminders', :path => "#{permissions_path}/Reminders"
  pod 'Permission-Siri', :path => "#{permissions_path}/Siri"
  pod 'Permission-SpeechRecognition', :path => "#{permissions_path}/SpeechRecognition"
  pod 'Permission-StoreKit', :path => "#{permissions_path}/StoreKit"

  pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga', :modular_headers => true

  # add the Firebase pod for Google Analytics
  pod 'Firebase/Analytics'
  # add pods for any other desired Firebase products
  # https://firebase.google.com/docs/ios/setup#available-pods


  target 'unblndTests' 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 these next few lines.
  # flipper_pods()
  # post_install do |installer|
  #  flipper_post_install(installer)
  # end
end

端子输出

In file included from /Users/adriaandebolle/htdocs/unblnd_app/ios/Pods/RCT-Folly/folly/synchronization/DistributedMutex.cpp:17: In file included from /Users/adriaandebolle/htdocs/unblnd_app/ios/Pods/Headers/Private/RCT-Folly/folly/synchronization/DistributedMutex.h:352: /Users/adriaandebolle/htdocs/unblnd_app/ios/Pods/Headers/Private/RCT-Folly/folly/synchronization/DistributedMutex-inl.h:1051:5: error: 'atomic_notify_one<unsigned long>' is unavailable
    atomic_notify_one(state);
    ^ /Users/adriaandebolle/htdocs/unblnd_app/ios/Pods/Headers/Private/RCT-Folly/folly/synchronization/DistributedMutex-inl.h:1573:5: note: in instantiation of function template specialization 'folly::detail::distributed_mutex::wakeTimedWaiters<std::__1::atomic<unsigned long>>' requested here
    wakeTimedWaiters(&state_, proxy.timedWaiters_);
    ^ In file included from /Users/adriaandebolle/htdocs/unblnd_app/ios/Pods/RCT-Folly/folly/synchronization/DistributedMutex.cpp:17: In file included from /Users/adriaandebolle/htdocs/unblnd_app/ios/Pods/Headers/Private/RCT-Folly/folly/synchronization/DistributedMutex.h:19: In file included from /Users/adriaandebolle/htdocs/unblnd_app/ios/Pods/Headers/Private/RCT-Folly/folly/Optional.h:58: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/include/c++/v1/functional:504: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/include/c++/v1/memory:681: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/include/c++/v1/atomic:2140:6: note: 'atomic_notify_one<unsigned long>' has been explicitly marked unavailable here void atomic_notify_one(atomic<_Tp>* __o) _NOEXCEPT
     ^ 1 error generated.

CompileC /Users/adriaandebolle/Library/Developer/Xcode/DerivedData/unblnd-cvaavakypguqqzftojmgjqbtdeij/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RCT-Folly.build/Objects-normal/x86_64/Demangle-3c4c6b43c285d16c32230d6f0a7a76ce5af39228ed5c3beeaf7ed7d1344f76b0.o /Users/adriaandebolle/htdocs/unblnd_app/ios/Pods/RCT-Folly/folly/detail/Demangle.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'RCT-Folly' from project 'Pods')

...

CompileC /Users/adriaandebolle/Library/Developer/Xcode/DerivedData/unblnd-cvaavakypguqqzftojmgjqbtdeij/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RCT-Folly.build/Objects-normal/x86_64/Cursor.o /Users/adriaandebolle/htdocs/unblnd_app/ios/Pods/RCT-Folly/folly/io/Cursor.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'RCT-Folly' from project 'Pods')
    cd /Users/adriaandebolle/htdocs/unblnd_app/ios/Pods
    export LANG\=en_US.US-ASCII
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/

...

** BUILD FAILED **


The following build commands failed:    CompileC /Users/adriaandebolle/Library/Developer/Xcode/DerivedData/unblnd-cvaavakypguqqzftojmgjqbtdeij/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RCT-Folly.build/Objects-normal/x86_64/DistributedMutex.o /Users/adriaandebolle/htdocs/unblnd_app/ios/Pods/RCT-Folly/folly/synchronization/DistributedMutex.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler (1 failure)

npx react-native info

System:
    OS: macOS 11.4
    CPU: (8) x64 Intel(R) Core(TM) i7-1068NG7 CPU @ 2.30GHz
    Memory: 1.05 GB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.17.0 - /usr/local/bin/node
    Yarn: Not Found
    npm: 6.14.13 - ~/htdocs/unblnd_app/node_modules/.bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.10.1 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4
    Android SDK:
      API Levels: 28, 29
      Build Tools: 28.0.3, 29.0.2, 29.0.3, 30.0.2
      System Images: android-29 | Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: 4.2 AI-202.7660.26.42.7351085
    Xcode: 12.5.1/12E507 - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_265 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.1 => 17.0.1 
    react-native: 0.64.2 => 0.64.2 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

经过大量的试验和错误,我找到了一个可行的解决方案。这有点奇怪,但我必须启用 Flipper。没有它我找不到办法。

感谢这个答案:https://github.com/facebook/react-native/issues/31179#issuecomment-831932941我发现了修复 Pod 的方法。

现在这是我的 Podfile:

  ...

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable these next few lines.
  use_flipper!({ 'Flipper' => '0.87' })
  post_install do |installer|
    flipper_post_install(installer)

    find_and_replace("Pods/Headers/Private/RCT-Folly/folly/synchronization/DistributedMutex-inl.h",
    "atomic_notify_one(state)", "folly::atomic_notify_one(state)")

    find_and_replace("Pods/Flipper-Folly/folly/synchronization/DistributedMutex-inl.h",
    "atomic_wait_until(&state, previous | data, deadline)", "folly::atomic_wait_until(&state, previous | data, deadline)")
  end

  ...
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

在 iOS 上使用 Hermes 时出现 RCT-Folly 错误 的相关文章

  • 使用 numpy tensordot 进行张量乘法

    我有一个张量 U 由 n 个维度 d k 的矩阵和一个维度 k n 的矩阵 V 组成 我想将它们相乘 以便结果返回一个维度为 d n 的矩阵 其中 j 列是 U 的矩阵 j 与 V 的 j 列之间的矩阵乘法的结果 获得此信息的一种可能方法是
  • 如何将位对从 uint64_t 解压缩到 __m256i?

    考虑uint64 t其中每连续 2 位都是一个数字 b00 for 0 b01 for 1 b11 for 1 and b10未使用 永远不会发生 假设没有对其进行处理 如何解压这样的uint64 t into m256i以便原始数字中的位
  • JavaScript 中 + 运算符和 concat() 方法有什么区别

    The 加 运算符 and String concat 方法给出相同的结果 加 运算符 str1 str2 字符串 concat 方法 str1 concat str2 另外 它写在w3学校 http www w3schools com j
  • 使用离子框架的语音识别

    我正在寻找一种使用离子框架进行语音识别的方法 我想在 ios 和 android 设备上运行一个应用程序 目前 我在 ios 和 android 中提供网络视图 并有一个通用的代码库 我想为其添加语音识别功能并获取语音的输出 如果您在 Go
  • 如何在android上使用离线包来反应本机项目?

    如何在 Android 上使用离线捆绑包 我没有看到关于在 android 上使用离线捆绑包的文档 我尝试取消注释 build gradle 中的代码 project ext react the name of the generated
  • 更改从 xib 加载的 UITableViewHeaderFooterView 上的背景颜色表示使用 contentView.backgroundColor

    I m 从 xib 文件创建 UITableViewHeaderFooterView https stackoverflow com a 20073742 35690 几乎一切都工作正常 问题是 现在当我尝试更改背景颜色 或者如果我在 xi
  • 如何在 Objective-C 的动画中使视图振动? [关闭]

    Closed 这个问题需要细节或清晰度 help closed questions 目前不接受答案 我有一个名为 qShake 的 UIView 当用户犯错误时 我希望该视图在一个小空间内短时间内从左到右晃动 我将如何创建动画来做到这一点
  • iOS 6 中的模态视图控制器强制横向方向

    我有一个以纵向模式呈现的 UITabBarController 在其中一个选项卡上 我有一个以模态方式显示 UIViewController 的按钮 一个简单的故事板 segue 执行该操作 我希望这个模态视图以横向模式显示 但我无法让它自
  • 如何在 Swift 3 中记录函数闭包参数的参数?

    在 Xcode 8 beta 和 Swift 3 中 当您有一个采用闭包作为参数的方法时 例如 func foo bar String gt Void bar Hello world 如何记录闭包所采用的参数 例如 如果我这样写 Calls
  • UITableView 部分始终保持在视图内

    我有一个包含 3 个部分的 UITableView 第 1 节 该部分的标题是 Players 内容恰好是 1 个单元格 包含 1 4 个玩家姓名的水平列表 第 2 节 该部分的标题是 回合 内容是 X 个单元格 每个单元格包含每个玩家在第
  • 检测其他应用程序何时在 React Native 应用程序中启动

    我希望我的 React Native 应用程序能够检测 Google 地图应用程序何时打开以显示一些旅行提示 是否可以 出于安全原因 您无法检测是否启动了其他应用程序 已安装的应用程序无法监听其他应用程序 因为它们是 沙盒 的 您只能与其他
  • 具有 3D 旋转功能的 CAEmitterCell

    我正在尝试使用 CAEmitterLayer 和 CAEmitterCell 重现从顶部落下的小纸片效果 到目前为止 我得到了它的 2D 动画 但是我很难让每个单元格在掉落时旋转 如何对每个粒子应用随机旋转 我尝试过 3D Transfor
  • 如何在代码中的UIToolBar中添加UIBarButtonItem

    我有标准 UIBarButtonItem UIBarButtonItem share UIBarButtonItem alloc initWithBarButtonSystemItem UIBarButtonSystemItemAction
  • iOS 11 /“Apps-prefs=root”功能在更新到 Swift 3 后不起作用

    我对 Swift 编程还很陌生 我制作了一个简单的测试应用程序 可以通过特定按钮以编程方式打开设置 不幸的是 更新按钮后 没有打开所需的设置页面 在本例中为 wifi 页面 而是仅打开通用设置屏幕 有人可以帮助我了解 swift 4 中究竟
  • 框架链接错误,找不到图像?

    我在我的应用程序中使用 DarwiinRemote 的 WiiRemote framework 我已经通过下载源代码并要求垃圾收集以及针对 10 5 进行构建来修复了一些问题 但是 当我尝试将其添加到我的项目时 我收到控制台错误 dyld
  • Measure 应用程序是否有可用的 URL 方案?

    我想推出新的测量应用程序 在 iOS 12 上 在我的应用程序中 这可能吗 应用程序是否有可用的 URL 方案可用于此目的 或者还有其他方法可以做到吗 Thanks 您似乎无法打开此应用程序 In the 文档存档 https develo
  • 允许沙盒应用程序的 HID 控制

    我们正在尝试对我们的应用程序进行沙箱处理 以将其提交到 Mac App Store 这是第一次 它很难使用较低级别的 Carbon API 并且无法以其他方式操作 当我启用沙箱时 某些功能停止工作 我在日志中看到以下消息 9 14 12 1
  • 尝试 Catch 性能 Java

    当捕获异常而不是进行检查时 try catch 需要多长时间 以纳秒为单位 假设消息具有用于查找的 HashMap 类型性能 try timestamp message getLongField MessageField TIMESTAMP
  • 归档时出现“没有此类模块”错误

    我的 Swift 4 应用程序在所有模拟器上重建并成功运行 除了Generic iOS Device 如果我尝试将其存档或重建Generic iOS Device 我得到一个No such module与我的 Pod 框架之一相关的错误 我
  • 如何从我的 appDelegate 访问我的 viewController? iOS系统

    我有一个在 xCode 中创建为 基于视图的应用程序 的 iOS 应用程序 我只有一个 viewController 但它会自动显示 而且我没有看到任何将它与我的 appDelegate 关联的代码 我需要将数据从 appDelegate

随机推荐

  • pygame 与海龟崩溃

    我收到此错误代码 2017 04 13 03 04 14 958 Python 606 839244 SDLApplication setup unrecognized selector sent to instance 0x1007a0d
  • SQL Server 2005 中的临时表不会自动删除

    我正在对一个令人讨厌的存储过程进行故障排除 并注意到在运行它之后 并且我已经关闭了会话 许多临时表仍然留在 tempdb 中 他们的名字如下 000E262B 002334C4 004E1D4D 00583EEE 00783A7F 0083
  • 使用 MTKTextureLoader 加载远程图像

    我正在尝试将远程图像加载到MTLTexture用这个代码 let textureLoader MTKTextureLoader device device textureLoader newTexture withContentsOf ur
  • 从Github API获取特定的README.md数据

    最近 我开始尝试使用 GitHub API 从公共存储库获取特定数据 长话短说 我想从存储库中获取 README md 文件的特定部分 例如 来自 Facebook 的 React 存储库的 master 分支 我想抓取下面的文本文档Git
  • 最小列总和差是多少? [关闭]

    Closed 这个问题需要多问focused 目前不接受答案 想象一下 给定一个正整数矩阵 最大 25 15 数字值不超过 3000000 当您进行列求和并选择最小和最大的一项时 它们之间的差异必须尽可能小 您可以根据需要交换每行中的数字
  • 以 HTML 形式显示的 LaTeX 表格

    我有以下 LateX 表 在以下情况下按预期呈现format pdf title Test Table format pdf begin center begin tabular l l l hline Var Class Descript
  • 用户名网址,例如 twitter 和 facebook

    twitter 和 facebook 等如何制作唯一的 url 例如 twitter com billgates 如果我想做同样的事情 为我的用户提供带有用户名的唯一网址 它是一个应用程序还是您为每个用户创建一个带有索引页面的目录 顺便说一
  • InvalidParameterValueException:无法访问流

    我正在尝试使用 Terraform 创建 dynamodb 表和 lambda 触发器 这就是我定义表 角色策略和 lambda 触发器的方式 resource aws dynamodb table filenames name local
  • 如何更新数组中嵌套的数组中的项目

    我通过最新的 C 驱动程序 此时为 v2 7 0 使用 MongoDB 4 0 我有一份文件 其中有Options and Options have Inventory 换句话说 库存数组嵌套在选项数组中 如何了解库存水平并仅更新库存 以下
  • 如何读取和修改已绘制的 Google 图表上的轴?

    我有一个页面 上面有几个谷歌图表 主要是组合图和折线图 例如 chart new google visualization LineChart chartDiv 绘制页面后 我希望能够读取轴上的最大值 然后重新绘制图表 以便它们在轴上都具有
  • 当存在多个路由时,使用查询字符串进行路由属性路由

    我有这个 HttpGet Route Cats public IHttpActionResult GetByCatId int catId HttpGet Route Cats public IHttpActionResult GetByN
  • 在 Ant 复制任务过滤器中获取文件名

    是否可以获取 Ant 复制任务中正在复制的当前文件名 我正在尝试运行 beanshell 脚本并希望访问当前文件名
  • 错误:无法在属性初始值设定项中使用实例成员 - Swift 3

    当我编译以下代码时 出现错误 无法在属性初始值设定项中使用实例成员 AddEployeeName 属性初始值设定项在 self 可用之前运行 你能帮忙解决这个错误吗 该计划允许员工输入姓名并拍摄照片 class AddEmployeeVie
  • 具有复杂形状的 ggplot 和 grid.picture 之间的区别

    我希望获得单个字母的 x y 坐标并用 ggplot 绘制它们 我在用grImport PostScriptTrace从 Postscript 文件获取 XML 文件 从那里 我从 Picture 类的 S4 对象中提取 x y 坐标 绘制
  • 断言 UITest 中的按钮上存在图像

    我在 ZStack 中有一个带有前景图像的按钮 Button action self highlighted self highlighted ZStack Text Text if self highlighted Image highl
  • pyspark 滞后函数(基于列)

    我想实现以下目标 lag column1 datediff column2 column3 over window 偏移量是动态的 我也尝试过使用UDF 但没有成功 有什么想法如何实现上述目标吗 论点count of the lag函数采用
  • 如何使用 Java 解析 JSON 二维数组

    我有这样的 json 数据 err code 0 date 20130121 time from 1242 range 5 data 12313123 BOOK CODE CYFV3M NUM CODE 3789850802600 0898
  • aws s3 java sdk 下载 pdf 被损坏

    我正在使用 getObject api 从 aws s3 下载文件 简单的文本文件工作正常 但在下载 pdf 时我的文件已损坏 我正在使用 FileOutputStream 并将内容保存在文件中 但保存的 pdf 已损坏 我不太确定用于此目
  • R 神经网络包对于数百万条记录来说太慢

    我正在尝试使用 R 包神经网络训练用于流失预测的神经网络 这是代码 data lt read csv C PredictChurn csv maxs lt apply data 2 max mins lt apply data 2 min
  • 在 iOS 上使用 Hermes 时出现 RCT-Folly 错误

    在 Podfile 中启用 Hermes 并重建构建时 由于 RCT Folly 它会失败 不知道它有什么作用 要重新初始化所有内容 我使用以下命令 rm rf node modules rm package lock json npm i