Xcode 错误:DistributedMutex-inl.h:1051:5: 'atomic_notify_one<unsigned long>' is unavailable

React Native 2021-11-09 阅读 2 评论 0

问题描述

Mac 升级到 macOS Big Sur 11.6,Xcode 升级到 13.0,在 Xcode 打开 React Native 项目,出现了错误:

/Volumes/develop/react/ios/Pods/Headers/Private/Flipper-Folly/folly/synchronization/DistributedMutex-inl.h:1051:5: 'atomic_notify_one' is unavailable

1. in file included from /Volumes/develop/react/ios/Pods/Flipper-Folly/folly/synchronization/DistributedMutex.cpp:17:
2. in file included from /Volumes/develop/react/ios/Pods/Headers/Private/Flipper-Folly/folly/synchronization/DistributedMutex.h:344:
3. In instantiation of function template specialization 'folly::detail::distributed_mutex::wakeTimedWaiters<std::atomic<unsigned long>>' requested here
4. 'atomic_notify_one<unsigned long>' has been explicitly marked unavailable here

package.js:

react: 16.11.0
react-native: 0.62.2

Podfile:

...
  use_native_modules!
  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable these next few lines.
  add_flipper_pods!('Flipper-Folly' => '2.3.0')
  post_install do |installer|
    flipper_post_install(installer)
  end
...

解决方法

升级 Flipper,修改 Podfile,如下:

   use_native_modules!
   # Enables Flipper.
   # Note that if you have use_frameworks! enabled, Flipper will not work and
   # you should disable these next few lines.
-  add_flipper_pods!('Flipper-Folly' => '2.3.0')
+  add_flipper_pods!({ 'Flipper-Folly' => '2.5.3', 'Flipper' => '0.87.0', 'Flipper-RSocket' => '1.3.1' })
   post_install do |installer|
     flipper_post_install(installer)
   end

重新 pod install,编译项目。

最后更新 2021-11-09