folly: 'folly/experimental/coro/Coroutine.h' file not found after upgrading to > RN 0.74
Currently upgrading to RN 0.75.2 from 0.73.x and encountered the error below on IOS, downgraded to RN 0.74.5 and had the same issue. Extensive research online seems to indicate that “folly/experimental” is deprecated and should no longer be available however it’s still being called somewhere. Not completely sure if this is the issue though. Uninstalling/removing RNBranch still gives the same error
Xcode version 15.3 Pod version 1.15.2 ruby 3.2.1 (2023-02-08 revision 31819e82c8) [arm64-darwin22]
❌ /Users/[REDACTED]/Library/Developer/Xcode/DerivedData/Oreille-bxxuvxrzbbojtictzbxfgyypfvxf/Build/Intermediates.noindex/ArchiveIntermediates/Oreille/BuildProductsPath/Release-iphoneos/RCT-Folly/folly.framework/Headers/folly/Optional.h:667:10: 'folly/experimental/coro/Coroutine.h' file not found
#include <folly/experimental/coro/Coroutine.h>
^
❌ /Users/[REDACTED]/Library/Developer/Xcode/DerivedData/Oreille-bxxuvxrzbbojtictzbxfgyypfvxf/Build/Intermediates.noindex/ArchiveIntermediates/Oreille/BuildProductsPath/Release-iphoneos/RCT-Folly/folly.framework/Headers/folly/Optional.h:667:10: 'folly/experimental/coro/Coroutine.h' file not found
#include <folly/experimental/coro/Coroutine.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
❌ /Users/[REDACTED]/Library/Developer/Xcode/DerivedData/Oreille-bxxuvxrzbbojtictzbxfgyypfvxf/Build/Intermediates.noindex/ArchiveIntermediates/Oreille/BuildProductsPath/Release-iphoneos/React-RCTAppDelegate/React_RCTAppDelegate.framework/Headers/RCTAppDelegate.h:8:9: could not build module 'React'
#import <React/RCTBridgeDelegate.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
❌ /Users/[REDACTED]/Library/Developer/Xcode/DerivedData/Oreille-bxxuvxrzbbojtictzbxfgyypfvxf/Build/Intermediates.noindex/ArchiveIntermediates/Oreille/BuildProductsPath/Release-iphoneos/react-native-branch/RNBranch.framework/Headers/RNBranch.h:2:9: could not build module 'React'
#import <React/RCTBridgeModule.h>
~~~~~~~^
The following build commands failed:
CompileC /Users/[REDACTED]/Library/Developer/Xcode/DerivedData/Oreille-bxxuvxrzbbojtictzbxfgyypfvxf/Build/Intermediates.noindex/ArchiveIntermediates/Oreille/IntermediateBuildFilesPath/Oreille.build/Release-iphoneos/Oreille.build/Objects-normal/arm64/AppDelegate.o /Users/[REDACTED]/git/ios/Oreille/AppDelegate.mm normal arm64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'Oreille' from project 'Oreille')
(1 failure)
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 4
- Comments: 18
Adding this to the
Podfileworks for me, as a way to automate the fix on CI:@p29hieu @dylanmaryk I may have fixed it by updating the post_install script
same problem, adding “-DFOLLY_CFG_NO_COROUTINES=1” to pbxproj NOT solved the issue
Upgrading to react native 0.77 fixes this for me.
0.77 updates RCT-Folly from 2024.01.01.00 to 2024.11.18.00 (here is the diff). Version 2024.11.18.00 has the missing
folly/experimental/coro/Coroutine.hfile.I upgraded to React Native 0.77 which builds fine normally, but when trying to integrate the Expo SDK with my RN app I get this:
I’ve confirmed in my
Podfile.lockthat I’m on2024.11.18.00, at least that version is present in a lot of places as a dependency like:My
ios/Pods/follydirectory does not contain acorofolder.I also just created a brand new RN project with:
that definitely uses RN 77, and installed cocoapods there, but there is also neither a
experimentalfolder nor acorofolder:but there are files that reference that 🤔
how is that supposed to work? I see the file present in the source for that tag, but it doesn’t seem to be in my system
Edit: I’ve restored the Podfile patch to set
FOLLY_HAS_COROUTINES 0inPortability.h, that builds successfully.I’have managed to solve this error coming from Optional.h header in RCT-Folly:
Problem
because of this code with import
./ios/Pods/Headers/Public/RCT-Folly/folly/Optional.hbecause
FOLLY_HAS_COROUTINESis1and there is noexperimentaldirectory infollySolution
Hardcode
FOLLY_HAS_COROUTINESto define always to0(line 549)(potentially after this commit)
And also comment some not important assertion:
still same issue
Pumping
react-native-gesture-handler, andreact-native-screensversions fixed the issue for mehey @dylanmaryk I’ve implemented the Podfile post_install script and it works locally but when using xcode cloud for example it fails with the
'folly/experimental/coro/Coroutine.h' file not founderror./Volumes/workspace/repository/ios/Pods/Headers/Public/RCT-Folly/folly/Optional.h:614:10: fatal error: 'folly/experimental/coro/Coroutine.h' file not found #include <folly/experimental/coro/Coroutine.h>This only happens on the CI/CD part. Do you have any clue on what could it be?
Adding
"-DFOLLY_CFG_NO_COROUTINES=1"to pbxproj solved the issueI got same issue. This only happens on CI/CD. I’m using CircleCI. This is my resource
Example how should be added: https://github.com/facebook/react-native/blob/ad341e39695d0e5ad3748f8fbb0ce51e58ade83d/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj#L1041