After upgrading Xcode to 12.5 and iOS to 14.5, I can’t run the iOS app on a real device nor in the simulator.
After running npm run ios
, I get this message:
The following build commands failed:
CompileC .../Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Flipper-Folly.build/Objects-normal/x86_64/DistributedMutex.o /Users/guilherme/Documents/Dood/ios/Pods/Flipper-Folly/folly/synchronization/DistributedMutex.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
If I try to run the app on a real device using Xcode, this is the error I get (related to Flipper-Folly):
.../ios/Pods/Headers/Private/Flipper-Folly/folly/synchronization/DistributedMutex-inl.h:1051:5: 'atomic_notify_one<unsigned long>' is unavailable
Ideas? Thanks!
UPDATE:
React native has been updated to 0.64.1. You can now just change your react-native dependency to this version within your package.json file, then run npm install
8
Answers
There's a solution I found here.
Add this to your
post_install
in your Podfile:You'll also need to add the function def for this
find_and_replace
function (you can put this function anywhere in the podfile):Run
pod install
again and it should work. If you get an error relating to permissions while accessing the DistributedMutex-inl.h file, delete your /pods folder and runpod install
againYou should see text print out that says Fix: Pods/Flipper-Folly/folly/synchronization/DistributedMutex-inl.h, etc. If you don't, double check the path in the find_and_replace call.
There is an open RN issue here: https://github.com/facebook/react-native/issues/31179
For me commenting out
Flipper
in thePodfile
,pod install
, and rebuild worked as a temp solution.just comment out the flipper line in a pod and in Xcode also if you are not using it, hope this will fix in future updates.
IN Xcode comment all import and flipper variable
Solution without losing Flipper functionality:
Define the upgraded dependencies for Flipper in the Podfile
React Native 62
React Native 63
cd ios && pod install
and you should be good to goReact Native 64
Bump the version to 0.64.1 in the
package.json
yarn install && pod install --repo-update && react-native run-ios
https://github.com/facebook/react-native/releases/tag/v0.64.1
React native 0.64.1 has been released and will solve this. Just update the version number in package.json.
"react-native": "0.64.1",
No need to modify the Podfile if you do this
Upgrade to react native 0.64.1 (or higher)
if you moved from 0.63.x to 0.64.x make sure that in your Podfile you’ve updated the use_flipper! section post install:
Before:
After:
run ‘npx react-native-clean-project‘ from project root
then from inside ‘./ios‘ folder run ‘pod install –repo-update‘ then maybe run ‘pod update’
that works, 😉
I know this is already answered, but for those who find this thread in the future there is an official link addressing this issue:
Xcode 12.5 troubleshooting guide (RN 0.61/0.62/0.63/0.64)