Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

React Native iOS build fails in fmt with 'call to consteval function ... not a constant expression'

Errorerror: call to consteval function 'fmt::basic_format_string<char, ...>::basic_format_string<FMT_COMPILE_STRING, 0>' is not a constant expression

Short answer

React Native's pods pin fmt 11.0.2, and Apple clang 21 in Xcode 26.4 rejects its FMT_STRING calls. The fix is fmt 12.1.0 or newer, which React Native 0.83.5 and the Expo SDK that uses it include. Update the framework, reinstall pods and rebuild. Compiler flags do not fix this.

  • Applies to React Native 0.83.x, Expo SDK 55, Xcode 26.4, CocoaPods
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Check which fmt version CocoaPods resolved. A 11.0.2 entry confirms this page; then check your React Native version.

    grep -n "fmt" ios/Podfile.lock
    npx react-native --version
  2. 2Match what you see, then jump to its fix

    1. 1ios/Podfile.lock lists fmt (11.0.2) and the errors point into ios/Pods/fmt/include/fmt/format-inl.h.The project still uses the React Native version that pins fmt 11.0.2Fix
    2. 2Adding -DFMT_USE_CONSTEVAL=0 to the pod's build settings changes nothing.Trying to switch consteval off with a compiler flagFix

What does the error look like?

  • error: call to consteval function 'fmt::basic_format_string<char, ...>::basic_format_string<FMT_COMPILE_STRING, 0>' is not a constant expression
  • Apple clang 21.0.0 (Xcode 26.4) fails in ios/Pods/fmt/include/fmt/format-inl.h

Cause 1 of 2

The project still uses the React Native version that pins fmt 11.0.2

1Check

The fmt issue tracker names fmt 11.0.2, pinned through the RCT-Folly pod, as the affected version, and Apple clang 21.0.0 from Xcode 26.4. The Expo issue reports React Native 0.83.2 with the same errors.

grep -n "fmt\|RCT-Folly" ios/Podfile.lock

2Fix

Update to a React Native release that bumps fmt. The Expo issue says React Native 0.83.5 updated fmt to fix Xcode 26.4 builds, and that for an Expo project the fix is to run expo install with the fix flag. Then reinstall pods.

npx expo install --fix
cd ios && pod install

3Verify

Confirm the lock file now shows fmt 12.1.0 or newer, then build.

grep -n "fmt" ios/Podfile.lock

Confirmed by github.com

Did this fix it?

Cause 2 of 2

Trying to switch consteval off with a compiler flag

1Check

The fmt issue explains that in 11.0.2 the FMT_USE_CONSTEVAL macro is not wrapped in an ifdef guard, so a -D flag is overwritten. Version 12.1.0 added the guard, and a value you set then takes precedence.

grep -rn "FMT_USE_CONSTEVAL" ios/Podfile ios/Pods/Target\ Support\ Files 2>/dev/null

2Fix

Remove the flag and move to fmt 12.1.0 or newer by updating React Native, as in the first cause.

cd ios && pod install

3Verify

Clean the build folder in Xcode and build again.

xcodebuild -workspace ios/MyApp.xcworkspace -scheme MyApp -configuration Debug build

Confirmed by github.com

Did this fix it?

How do I stop it coming back?

  • Upgrade React Native patch releases when Apple ships a new Xcode, before you update Xcode on CI.
  • Run pod install after every dependency update and commit Podfile.lock.
  • Keep one Xcode version per branch on CI so a build does not change under you.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.