React Native Environment Info:
System:
OS: macOS High Sierra 10.13.6
CPU: x64 Intel(R) Core(TM) i7-6567U CPU @ 3.30GHz
Memory: 170.61 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 8.10.0 - ~/.nvm/versions/node/v8.10.0/bin/node
Yarn: 1.7.0 - /usr/local/bin/yarn
npm: 6.4.1 - ~/.nvm/versions/node/v8.10.0/bin/npm
Watchman: 4.7.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 11.4, macOS 10.13, tvOS 11.4, watchOS 4.3
Android SDK:
Build Tools: 19.1.0, 20.0.0, 23.0.1, 23.0.2, 23.0.3, 24.0.0, 24.0.1, 24.0.2, 24.0.3, 25.0.0, 25.0.1, 25.0.2, 25.0.3, 26.0.0, 26.0.1, 26.0.2, 26.0.3, 27.0.0, 27.0.1, 27.0.2, 27.0.3, 28.0.3
API Levels: 22, 23, 24, 25, 26, 27
IDEs:
Android Studio: 3.1 AI-173.4907809
Xcode: 9.4.1/9F2000 - /usr/bin/xcodebuild
npmPackages:
react: 16.5.0 => 16.5.0
react-native: ^0.57.1 => 0.57.1
RN 0.57.1
RN-cli 2.0.1
xCode: 9.4.1 (9F2000) or xCode 10
"babel-core": "7.0.0-bridge.0",
"babel-plugin-transform-runtime": "7.0.0-beta.3",
"babel-preset-latest": "7.0.0-alpha.7",
"babel-preset-stage-0": "7.0.0-beta.3",
"babel-register": "7.0.0-beta.3",
"metro-react-native-babel-preset": "^0.45.6",
After an update of RN from 0.56 to 0.57.0 (or 0.57.1) I get a lot of could not build module 'CoreFoundation' or could not build module Foundation or limits file not found
I followed exactly the steps from RN doc for this update.
I tried removing ios/build folder, cleaning cache, re-installing everything but nothing worked.
â–¸ Building BunteMobile/OneSignalNotificationServiceExtension [Debug] â–¸ Check Dependencies â–¸ Compiling NotificationService.m
/Users/myuser/Desktop/projects/mobileapp/ios/../node_modules/react-native/ReactCommon/fabric/graphics/platform/ios/float.h:8:10: 'limits' file not found
include
/Users/myuser/Desktop/projects/mobileapp/ios/../node_modules/react-native/ReactCommon/fabric/graphics/platform/ios/float.h:8:10: 'limits' file not found
include
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:10: could not build module 'CoreFoundation'
include
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Security.framework/Headers/SecBase.h:28:10: could not build module 'CoreFoundation'
include
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetwork.h:18:10: could not build module 'CoreFoundation'
include
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/NSString+UserNotifications.h:8:9: could not build module 'Foundation'
import
If I remove the OneSignalNotificationServiceExtension instead of 7 errors I get another 15 errors in other parts of the project:
/Users/myuser/Desktop/projects/mobileapp/ios/../node_modules/react-native/ReactCommon/fabric/graphics/platform/ios/float.h:8:10: 'limits' file not found
include
/Users/myuser/Desktop/projects/mobileapp/ios/../node_modules/react-native/ReactCommon/fabric/graphics/platform/ios/float.h:8:10: 'limits' file not found
include
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:10: could not build module 'CoreFoundation'
include
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/Security.framework/Headers/SecBase.h:28:10: could not build module 'CoreFoundation'
include
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetwork.h:18:10: could not build module 'CoreFoundation'
include
/Users/myuser/Desktop/projects/mobileapp/ios/build/Build/Products/Debug-iphonesimulator/include/React/RCTBridgeModule.h:8:9: could not build module 'Foundation'
import
The only workaround that I found is to downgrade RN back to 0.56...
I also added a question in stack overflow here:
https://stackoverflow.com/questions/52649586/react-native-0-57-ios-could-not-build-module-corefoundation-or-foundation
I am not sure if this is a bug in RN 0.57 or a problem with the update steps or some cache issue
I cannot provide a reproducible demo
I cannot provide a reproducible demo
Without that it's borderline impossible for us to help you.
That said, it seems to me that you need to update your babel related dependencies: in 0.57 as said in the Changelog we have moved to the stable release, while instead you are still on the alpha/beta phases as you wrote
"babel-plugin-transform-runtime": "7.0.0-beta.3",
"babel-preset-latest": "7.0.0-alpha.7",
"babel-preset-stage-0": "7.0.0-beta.3",
"babel-register": "7.0.0-beta.3",
I think that upgrading to babel stable, and then doing a proper full clean up
rm -rf $TMPDIR/react-*; rm -rf $TMPDIR/haste-*; rm -rf $TMPDIR/metro-*; watchman watch-del-all
Then remove the node_modules and then remove the builds artifacts folder of Xcode could help you.
"babel-plugin-transform-runtime": "7.0.0-beta.3",
"babel-preset-latest": "7.0.0-alpha.7",
"babel-preset-stage-0": "7.0.0-beta.3",
"babel-register": "7.0.0-beta.3",
These are latest dependencies versions yarn finds.
How should the package json deps look like?
According to the readme we should set "^7.0.0" for all of them but that version is not found
That's because you need to migrate to the new format, most packages have been renamed.
I, too, have the same problem.

I've follow the steps to upgrade to 0.57.1 as well
I kept my dev-dependencies to the very minimal. I mimic the the package.json from new react-native project (from react-native init)
"devDependencies": {
"babel-jest": "23.6.0",
"jest": "22.4.3",
"metro-react-native-babel-preset": "0.48.0",
"react-test-renderer": "16.3.1",
"prettier": "1.12.1",
"pretty-quick": "^1.5.1"
}
I have a similar problem - limits File not found - with Lottie-react-native since RN 0.57. Although it's not constant. Sometimes build faild, sometimes not. Sometimes builds from command line (using Fastlane) fails, sometimes they succeed. Sometimes it succeed in the command line, but fails from XCode (9.4.1) . As if some process didn't get killed correctly before.
That's because you need to migrate to the new format, most packages have been renamed.
I updated all the babel deps to babel 7 but I still get the ios crashes at build.
I used babel-upgrade to make that update.
I have similar issue and I solved it by:
Would appreciate if somebody can lemme know what is going on tho, a bit like the libfishhook.a issue, just remove and add it back then works lol
I removed React and ReactCommon from OneSignalExtension header search paths and from project header search paths. Now I have React only in project target header search paths.
Now it builds, run and archives ok but I do not know why.
Should React be only in the project target and not in project and extensions also?
Should ReactCommon be anywhere in header search paths?
I wonder why it worked until 0.57....
@fdobre we fixed it by doing the same thing--moving React from the Project header search paths to the Target. Not sure what changed in RN internals to cause this
I also fixed it by removing React and ReactCommon from Project header search path. Maybe this was required in the previous versions (My app was created 2 years ago). I also react-native init new app and don't see React and ReactCommon in project header search path. If this needs to be changed, it should be added in the 0.57 change log
I can confirm removing ReactCommon path from Header search path on my target solved it for me.
It's a shame this wasn't documented as a breaking change for the latest version. It took me a whole day to compare a fresh project created with react-native init and our projet which has a lot of native dependencies and build scripts.
Please do this first and clean your projet and your DerivedData before going insane if you're stuck with Foundation, CoreFoundation or limits.h.
None of the above is working for me anymore, using 57.1. Only happening on product achieve now. Stuck now. Why does every update have to break something every-single-time. 👎
Any word on this? I'm also experiencing this issue. I do not have React or ReactCommon in my header search path.
@fdobre, if remove React and ReactCommon in "Header Search Path", how can they find React headers?
I'm brand new to React Native, just followed the official tutorial and created the first RN project by using "react-native init". (My environment is up to date as I just started today. That is to say, RN v0.57.8, node v11.6.0, Xcode 10.1, etcs. )
The xcode project created by "react-native init" won't compile. Error "
Tutorial doesn't say we need to do anything on "Header Search Path". But I've tried to add header location of React and ReactCommon in all project's "Header Search Path".
After done #2, it does find the headers but now getting bunch of "limits file not found", "Could not build module 'CoreFundation'", etcs. The same errors as you guys got. But I can't get rid of header search path, otherwise the headers not found error comes up.
Did I miss some critical steps which never mentioned in tutorial?Or maybe just nobody is caring about the project created by "reactive-init".
@likai057187 my answer was for RN 0.57.1 and RN0.57.2 and there is a difference between project header search paths and target header search paths.
I added some print screens related to my case here:
https://stackoverflow.com/questions/52649586/react-native-0-57-ios-limits-file-not-found-could-not-build-module-corefoundatio
0.58 has several Xcode fixes. Can we verify this issue is still present in 0.58?
@hramos On 0.58 still seeing the same error.
I removed React and ReactCommon from OneSignalExtension header search paths and from project header search paths, and then only add React, it's work.
I have been seeing this ever since we upgraded to XCode 10 (we still have to switch to the legacy build system). Not only does it happen locally, which I resolve (sometimes) by nuking node_modules and cleaning the build, but it is also a transient build failure on our CI server, which starts from a completely clean slate every time and fetches everything. It makes me wonder if there is some kind of race condition happening in dependency loading, since a fresh rebuild on CI usually works if it fails the first time.
Solution: make sure to remove ReactCommon from the header search path's in your iOS projects.
Why: The problem is it is pulling in cpp code, which contains references to the standard library.
I do not have ReactCommon in my header search paths. Those were removed months ago.
@lunarraid Also feels like an XCode 10 compatibility issue. Before I updated to XCode 10 on the CI, I never experienced this issue. Even with RN 0.57.8.
A fix would be great - builds are intermittently failing on our CI
I wonder if does that happens on RN 0.59 as well?
So I have been running into this issue as well. First we ran into this issue, removing React and ReactCommon from our Header Search paths helped. Then we updated our CI machine to Mojave and Xcode 10.2, it started to break again. I saw the same error but this time from one of the libraries we were using, lottie-react-native, in this case. lottie-react-native fixed it in one of their latest version by removing React and ReactCommon from their Header Search paths.
My point is, if you're seeing this issue, try to see whether you need to remove React and ReactCommon from your Header Search or it's one of the libraries you're using that needs to remove those paths.
Here are some more readings on this issue:
https://stackoverflow.com/a/53278612
https://github.com/react-native-community/lottie-react-native/pull/382
https://stackoverflow.com/questions/52649586/react-native-0-57-ios-limits-file-not-found-could-not-build-module-corefoundatio
Hopefully this will help you guys.
I ran into this problem using Xcode 10.2.1 and upgrading the project to RN 0.58.6
Bij removing all references to React and ReactCommon from all Project and Target Header Search Paths (main project plus RNSound, none of the others) the problem was solved.
I didn't experience this in 0.59.x but am experiencing it on 0.60.0 upgrade.
EDIT: I seemed to resolve this issue by adding the following to my Podfile
pod 'React-RCTPushNotification', :path => '../node_modules/react-native/Libraries/PushNotificationIOS'
Took me a long time to figure this out because the error was totally unrelated to that missing Pod.
Seems like the dependencies need to be 100% right or ios build explodes with wild errors.
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.
Most helpful comment
I also fixed it by removing React and ReactCommon from Project header search path. Maybe this was required in the previous versions (My app was created 2 years ago). I also
react-native initnew app and don't see React and ReactCommon in project header search path. If this needs to be changed, it should be added in the 0.57 change log