react-native: Xcode 16.3 and undefined template 'std::char_traits' prevent building the app
Description
Xcode 16.3 removes the base template for std::char_traits: https://developer.apple.com/documentation/xcode-release-notes/xcode-16_3-release-notes
This prevents to build iOS app with new Xcode 16.3.
Steps to reproduce
Try to build app with Xcode 16.3
React Native Version
0.76.8
Affected Platforms
Build - iOS
Output of npx @react-native-community/cli info
Not needed
Stacktrace or Logs
Not needed
Reproducer
https://github.com/react-native-community/rn-diff-purge/tree/release/0.76.8
Screenshots and Videos
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 141
- Comments: 100 (5 by maintainers)
In case someone needs to downgrade Xcode (manually), here’s how to:
📦 How to Downgrade Xcode from 16.3 to 16.2
If you need to downgrade Xcode for compatibility or stability reasons, here’s a step-by-step guide to go from Xcode 16.3 to 16.2.
🧹 1. Remove or Rename Xcode 16.3
You can’t have two versions of Xcode named
Xcode.appin/Applications, so either delete or rename the current version.🔥 Delete Xcode 16.3
💾 OR Rename It (if you want to keep it)
📥 2. Download Xcode 16.2
Go to the official Apple Developer Downloads page:
🔗 https://developer.apple.com/download/all/
.xiparchive (approx. 12GB).📦 3. Install Xcode 16.2
Once downloaded:
.xipto extractXcode.app.✅ 4. Set Xcode 16.2 as the Active Version
Use
xcode-selectto make sure your system points to the correct Xcode version:Then verify:
Expected output:
You can also just download the old Xcode version, rename it to
Xcode_16.2or something you want, place it into theApplicationsfolder. And then open theXcode16.3, got toSettings -> Locationsand you will be able to select the version you want forCommand Line Tools.Confirming this works
However, before attempting to build your mobile app, make sure you delete your
DerivedDatafolder from/Library/Developer/Xcode/DerivedDataafter reinstalling. It also doesn’t hurt to restart your system too.Doing both made sure the 16.2 reinstallation worked for me the first attempt. Good luck!
Guys, everyone has already understood perfectly well that it is possible to roll back to Xcode 16.2. There is no need for everyone to write about it.
But the question is still when to expect a fix from the React Native side?
By the way, the reason of issue is indicated in the Xcode release note:
So in any case, you’ll have to wait for the fix by React Native community.
I also note that the new version of Xcode is undergoing beta testing. It’s very upsetting that no one from React Native community has mentioned this issue before. Or is no one using Xcode beta? )
Apparantly the new upgrade xcode 16.3 is causing this issue. Downgrade to Xcode 16.2 and it works fine it seems.
same issue on react native 0.72.17
Implicit instantiation of undefined template 'std::char_traits<fmt::internal::char8_type>'Only downgrading the Xcode version can help now. Don’t waste your time, do a downgrade.
downgrading to 16.2 works I love xcode so much
"react-native": "0.77.2"seems to be building fine. So issue is up to0.76.8.@lorenc-tomasz thanks for opening the issue. This is something we were not expecting, as it is not a best practice to remove a type without warning first. We will try to fix it ass soon as possible.
@xubmuajkub we will not fix 0.71, as it is out of the support window @VanDinh18 we will not fix 0.72 as it is out of the support window @wdcs-krunalsatapara we will not fix 0.74 as it is out of the support window
I strongly advise you all to upgrade to a version in the support window. The version in the support windows are now 0.76, 0.77 and 0.78.
Not the worst April Fools’ joke. Same issue on
0.75.4guys, they just released the patch https://github.com/facebook/react-native/releases/tag/v0.76.9
Waiting for the next update in XCODE.
From our investigation, the only affected version is React Native 0.76. We identified the source of the problem being the Folly version used in 0.76 (which is folly 2024.1.1). All the other versions of React Native use folly 2024.11.18
We will fix 0.76 in the next release.
We will not release versions of React Native < 0.76. As mentioned above, you can downgrade Xcode if you can’t upgrade to a supported version. Another way to downgrade is to install the
Xcodes.app(highly recommended!) to have multiple versions of Xcode installed on your system.same issue on react native 0.74.1 Implicit instantiation of undefined template ‘std::char_traits<unsigned char>’
For those working with Expo, there was a patch topic at https://expo.dev/changelog/xcode-16-3-patches I followed and it works !
Then you need to upgrade Reanimated, then react-native-screens, then react-native-svg etc. 🙈
I’m using an Expo project set up with
0.76.7. It worked for me on latest XCode after I ran the following:npm i -s react-native@0.77.2and
npx expo install expo-dev-clientThe first command not only updates react-native core but also any other react-native packages that need to be upgraded. The second one was a fancy way of updating expo-dev-client in my packages to the latest. This runs for me on XCode 16.3
@cipolleschi Thanks. I guess no one could expect that they remove type. On the other hand it’s Apple and they did similar things in the past.
Workarounds:
AppDelegate.swift, just remember about: https://reactnative.dev/blog/2025/01/21/version-0.77#rctappdependencyprovider).Same issue on
"react-native": "0.71.7"Same issue
React Native: 0.71.18
Same issue using react-native 0.74.3, downgrading to XCode 16.2 fix it.
By the way, I just discover this tool to manage multiple XCode version, it’s really awesome: https://www.xcodes.app/
Downgrading Xcode 16.2 works for me.
Downgrading Xcode to 16.2 works for me.
Thanks!
I followed this but still its not working,
I got and error after:
https://github.com/getsentry/sentry-react-native/issues/4715
This is nothing new unfortunately, though this is the first time I’ve had to downgrade (usually I’ve been able to solve similar issues with some configuration changes).
Thanks for the instructions though, @brandtnewlabs
It’s not a solutions. Please suggest a solution if we can can work on the same react native version.
I faced the same issue, but downgrading Xcode to 16.2 works for me. Thanks.
Same issue with: react-native 0.76.6, Expo 52.0.27 and Xcode 16.3.
✅ Downgrading worked.
(I love how this type of stuff is happening each year)
Just look at the thread… 🤦♂ downgrade to Xcode version 16.2
It will hamper a lot.
I was able to reproduce the issue with RN
0.76.8and Xcode16.3on a new project (npx @react-native-community/cli@latest init --version 0.76.8).Pasting the full log for reference
RN
0.78.0works for me without any issues.Are u sure it fine with 77.2?
https://xcodereleases.com/ 16.2 helped me
I’ve updated to React Native version 0.77.2 and now it works.
Worked great for me to get dev builds working on iOS simulator again (and updated to 0.77.2). Thank you.
Same here
react-native: 0.76.7 Xcode 16.3
Same issue.
I have to downgrade to Xcode v16.2
Same issue for me, using
react-native: 0.75.5. Downgrade to 16.2 helped.Seeing the same issue in versions 72->73
Thanks for opening this issue! I started thinking who is going to prepare a reproducible repo now 😕 Btw, downgrading xcode works. Waiting for the RN fix…
If anyone is downgrading don’t forget to remove
DerivedDatafrom/Library/Developer/Xcode/DerivedData. You might get some build error while running in simulator.I saw the issue in react native 0.77.1 (via Expo) as well.
Same issue on
"react-native": "0.75.4", I’m upgrading the react-native version to0.76.7Thanks @brandtnewlabs.