facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
118.9k stars 24.3k forks source link

react-native 0.64 Range.h:44:10: fatal error: 'fmt/format.h' file not found #include <fmt/format.h> and Flipper-Folly/folly/concurrency/CacheLocality.cpp:25:10: fatal error: 'fmt/core.h' file not found #31365

Closed LewinJun closed 1 year ago

LewinJun commented 3 years ago

react-native-cli: 2.0.1 create project

Description

React Native version:

System: OS: macOS 10.15.5 CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz Memory: 891.52 MB / 32.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 12.16.1 - /usr/local/bin/node Yarn: 1.22.4 - /usr/local/bin/yarn npm: 6.13.4 - /usr/local/bin/npm Watchman: Not Found Managers: CocoaPods: 1.10.1 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: iOS 14.4, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2 Android SDK: API Levels: 19, 22, 23, 26, 28, 29, 30 Build Tools: 28.0.3, 29.0.2, 29.0.3, 30.0.2 System Images: android-30 | Google Play Intel x86 Atom Android NDK: Not Found IDEs: Android Studio: 4.1 AI-201.8743.12.41.6953283 Xcode: 12.4/12D4e - /usr/bin/xcodebuild Languages: Java: 1.8.0_201 - /usr/bin/javac Python: 2.7.16 - /usr/bin/python npmPackages: @react-native-community/cli: Not Found react: 17.0.1 => 17.0.1 react-native: 0.64.0 => 0.64.0 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

  1. react-native init Test064
  2. yarn start

Expected Results

                                   static_cast<void>( )

In file included from /Users/apple/Documents/work/git/reactNativeUiComponent/ios/Pods/Flipper-Folly/folly/concurrency/CacheLocality.cpp:17: In file included from /Users/apple/Documents/work/git/reactNativeUiComponent/ios/Pods/Headers/Private/Flipper-Folly/folly/concurrency/CacheLocality.h:25: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/mutex:190: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/mutex_base:15: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/system_error:145: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/errc:104: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno:26: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/errno.h:31: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/errno.h:23: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/sys/errno.h:81:15: note: expanded from macro 'errno'

define errno (*__error())

          ^

/Users/apple/Documents/work/git/reactNativeUiComponent/ios/Pods/Flipper-Folly/folly/concurrency/CacheLocality.cpp:25:10: fatal error: 'fmt/core.h' file not found

include <fmt/core.h>

     ^~~~~~~~~~~~

In file included from /Users/apple/Documents/work/git/reactNativeUiComponent/ios/Pods/Flipper-Folly/folly/synchronization/AsymmetricMemoryBarrier.cpp:21: In file included from /Users/apple/Documents/work/git/reactNativeUiComponent/ios/Pods/Headers/Private/Flipper-Folly/folly/Exception.h:25: In file included from /Users/apple/Documents/work/git/reactNativeUiComponent/ios/Pods/Headers/Private/Flipper-Folly/folly/Conv.h:116: In file included from /Users/apple/Documents/work/git/reactNativeUiComponent/ios/Pods/Headers/Private/Flipper-Folly/folly/Demangle.h:19: /Users/apple/Documents/work/git/reactNativeUiComponent/ios/Pods/Headers/Private/Flipper-Folly/folly/FBString.h:1693:72: warning: possible misuse of comma operator here [-Wcomma] "basic_fbstring: null pointer initializer not valid"), ^ /Users/apple/Documents/work/git/reactNativeUiComponent/ios/Pods/Headers/Private/Flipper-Folly/folly/FBString.h:1692:15: note: cast expression to void to silence warning : (throw_exception( ^~~~~~~~~~ static_cast( In file included from /Users/apple/Documents/work/git/reactNativeUiComponent/ios/Pods/Flipper-Folly/folly/synchronization/AsymmetricMemoryBarrier.cpp:21: In file included from /Users/apple/Documents/work/git/reactNativeUiComponent/ios/Pods/Headers/Private/Flipper-Folly/folly/Exception.h:25: In file included from /Users/apple/Documents/work/git/reactNativeUiComponent/ios/Pods/Headers/Private/Flipper-Folly/folly/Conv.h:120: /Users/apple/Documents/work/git/reactNativeUiComponent/ios/Pods/Headers/Private/Flipper-Folly/folly/Range.h:44:10: fatal error: 'fmt/format.h' file not found

include <fmt/format.h>

     ^~~~~~~~~~~~~~
stien commented 3 years ago

Has there been a workaround for this?

LewinJun commented 3 years ago

Has there been a workaround for this?

Podfile #use_flipper or delete use_filpper

oferRounds commented 3 years ago

Seeing this error with React Native 0.65.1 with use_frameworks! (and without flipper, which can’t be combined with use_frameworks!) Any workaround?

kuzzmi commented 3 years ago

Same happens with 0.65.1 when I use :hermes_enabled => true, but works fine with false.

fmorau commented 3 years ago

@LewinJun did you find a solution for it?

liamxujia commented 2 years ago

try spec.pod_target_xcconfig append \"$(PODS_ROOT)/fmt/include/\".

cortinico commented 1 year ago

Closing as this version of React Native is several years old. Please re-open a new issue against the latest stable if the issue persists

DarrKing commented 6 months ago

Happening for myself on 0.73.6

jahnagoldman commented 6 months ago

This is also happening for me on 0.74.0

AnshulRaghav commented 4 months ago

This is also happening for me on 0.74.0

@jahnagoldman were you able to find a solution for this?

iChristosK commented 1 day ago

Facing the same issue on 0.73.8

jahnagoldman commented 19 hours ago

This is also happening for me on 0.74.0

@jahnagoldman were you able to find a solution for this?

Sorry, I'm not 100% sure on the cause for this, but later on I tried again to upgrade (this time to 0.74.5), updated a bunch of other dependencies, followed the react native upgrade helper, and managed to get past this issue. So could be worth trying something like that.

AnshulRaghav commented 8 hours ago

This is also happening for me on 0.74.0

@jahnagoldman were you able to find a solution for this?

Sorry, I'm not 100% sure on the cause for this, but later on I tried again to upgrade (this time to 0.74.5), updated a bunch of other dependencies, followed the react native upgrade helper, and managed to get past this issue. So could be worth trying something like that.

Yeah, I, too, had to update the packages and XCode as well