Table of contents

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

React Native Nov 09, 2021 Viewed 18 Comments 0

Issue

I upgraded my Mac to macOS Big Sur 11.6 and Xcode to 13.0. When I opened the React Native project in Xcode, an error occurred:

/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
...

Solution

Update Flipper in Podfile to look like this:

   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

Run pod repo update inside the ios folder. And finally, update your project pods using pod install.

Updated Nov 09, 2021