react-native: RCT-Folly error after upgradeing xcode Version 15.0 (15A240d)
Description
The following build commands failed: CompileC <LOCATION>-duhrncqankvmlvaqzannliomyfdw/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RCT-Folly.build/Objects-normal/arm64/json.o <LOCATION>/ios/Pods/RCT-Folly/folly/json.cpp normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target ‘RCT-Folly’ from project ‘Pods’) (1 failure)
React Native Version
0.72.4
Output of npx react-native info
System: OS: macOS 13.5.2 CPU: (8) arm64 Apple M1 Pro Memory: 105.25 MB / 16.00 GB Shell: version: “5.9” path: /bin/zsh Binaries: Node: version: 18.17.1 path: /opt/homebrew/bin/node Yarn: version: 3.6.3 path: ~/node_modules/.bin/yarn npm: version: 9.6.7 path: /opt/homebrew/bin/npm Watchman: version: 2023.08.14.00 path: /opt/homebrew/bin/watchman Managers: CocoaPods: version: 1.12.1 path: /opt/homebrew/opt/ruby/bin/pod SDKs: iOS SDK: Platforms: - DriverKit 23.0 - iOS 17.0 - macOS 14.0 - tvOS 17.0 - watchOS 10.0 Android SDK: API Levels: - “23” - “29” - “30” - “31” - “32” - “33” Build Tools: - 29.0.0 - 29.0.1 - 29.0.2 - 29.0.3 - 30.0.0 - 30.0.1 - 30.0.2 - 30.0.3 - 31.0.0 - 32.0.0 - 32.1.0 - 33.0.0 System Images: - android-29 | Intel x86 Atom_64 - android-29 | Google APIs ARM 64 v8a - android-29 | Google APIs Intel x86 Atom - android-30 | Intel x86 Atom_64 - android-30 | Google APIs ARM 64 v8a - android-30 | Google APIs Intel x86 Atom - android-31 | Intel x86 Atom_64 - android-32 | Google APIs ARM 64 v8a - android-32 | Google APIs Intel x86 Atom_64 - android-32 | Google Play ARM 64 v8a - android-32 | Google Play Intel x86 Atom_64 - android-33 | Google APIs ARM 64 v8a Android NDK: Not Found IDEs: Android Studio: 2022.3 AI-223.8836.35.2231.10671973 Xcode: version: 15.0/15A240d path: /usr/bin/xcodebuild Languages: Java: version: 11.0.20 path: /usr/bin/javac Ruby: version: 3.2.2 path: /opt/homebrew/opt/ruby/bin/ruby npmPackages: “@react-native-community/cli”: Not Found react: installed: 18.2.0 wanted: 18.2.0 react-native: installed: 0.72.4 wanted: 0.72.4 react-native-macos: Not Found npmGlobalPackages: “react-native”: Not Found Android: hermesEnabled: false newArchEnabled: false iOS: hermesEnabled: true newArchEnabled: false
Steps to reproduce
yarn react-native run-iOS
Snack, screenshot, or link to a repository
it’s confidential
About this issue
- Original URL
- State: closed
- Created 9 months ago
- Reactions: 23
- Comments: 24 (2 by maintainers)
https://github.com/facebook/react-native/issues/37748
It’s worked for me
Hi there! Please:
react_native_post_install
hook in your Podfile’spost_install_hook
. Like this__apply_Xcode_12_5_M1_post_install_workaround
as shown above.We released a new version of React Native this week that should address all these problems:
If you don’t need xcode Version 15.0 you can downgrade to previous version :
Command Line Tools
field (if you don’t see the downloaded version try close an reopen Xcode)npx react-native info
=> You should seeXcode: 14.3.1
in theIDEs
sectionyarn react-native run-iOS
This worked for me
I Just run the project at xcode, crashed and after that xcode suggested me to fix a line at file hash.hpp.
This is what a changed!
#else template <typename T> struct hash_base : std::__unary_function<T, std::size_t> {}; #endif
This is the code what crashed before
#else template <typename T> struct hash_base : std::unary_function<T, std::size_t> {}; #endif
Also encountered this issue and the fix was to add
__apply_Xcode_12_5_M1_post_install_workaround(installer)
in thepost_install
step of thePodfile
. We had left that out at some point since it didn’t seem necessary before, but now it looks like it’s required.Good call. That helped resolve the issue for me. I needed that 12_5 fix and the 14_3.
Here’s what I added to my pod file:
-before your project and target-
-here’s what the post installer looks like-
Getting a similar RTC-Folly error. Xcode 15 with RN 0.72.5. Xcode says the error is in Folly/Time line 52, see screen. Error was occurring on RN 0.71.7 as well. Upgraded RN in an attempt to troubleshoot the issue.
RCT-Folly/folly/portability/Time.h:52:17
“Typedef redefinition with different types (‘uint8_t’ (aka ‘unsigned char’) vs ‘enum clockid_t’)”
@techamit95ch Based on https://github.com/facebook/react-native/issues/37748 I’ve created this def in my podfile:
You can use it in the post_install script like this:
still getting the same issue with all beforementioned invocations on latest x-code with RN 0.72.6