I’m trying to make some updates to an older project and facing the normal headaches that come with supporting the updates to new iOS versions. After running some npm updates and a react native upgrade I was able to successfully pod install, but now when I run-ios it fails to build with the following error:
The following build commands failed:
PhaseScriptExecution [CP-User] [RN]Check rncore .../Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-Fabric.build/Script-EC9C377125AD0589400F123D2D4CB2D3.sh (in target 'React-Fabric' from project 'Pods')
Here’s my react native info:
info Fetching system and libraries information...
System:
OS: macOS 14.5
CPU: (8) arm64 Apple M3
Memory: 82.38 MB / 16.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 20.16.0
path: ~/.nvm/versions/node/v20.16.0/bin/node
Yarn: Not Found
npm:
version: 10.8.1
path: ~/.nvm/versions/node/v20.16.0/bin/npm
Watchman:
version: 2024.07.29.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.15.2
path: /opt/homebrew/lib/ruby/gems/3.3.0/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 23.5
- iOS 17.5
- macOS 14.5
- tvOS 17.5
- visionOS 1.2
- watchOS 10.5
Android SDK: Not Found
IDEs:
Android Studio: 2024.1 AI-241.18034.62.2411.12071903
Xcode:
version: 15.4/15F31d
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.12
path: /usr/bin/javac
Ruby:
version: 3.3.4
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.74.5
wanted: 0.74.5
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: false
newArchEnabled: false
iOS:
hermesEnabled: false
newArchEnabled: false
Any ideas where I can begin to resolve this issue?
UPDATE
After digging a bit deeper here’s the build file that’s failing:
echo "Checking whether Codegen has run..."
rncorePath="$REACT_NATIVE_PATH/ReactCommon/react/renderer/components/rncore"
if [[ ! -d "$rncorePath" ]]; then
echo 'error: Codegen did not run properly in your project. Please reinstall cocoapods with `bundle exec pod install`.'
exit 1
fi
So for some reason that $REACT_NATIVE_PATH/ReactCommon/react/renderer/components/rncore
path does not exist. I’m not sure why and I’ll continue to research.
2
Answers
It seems the codegen was not working due to some pods trying to use minimum support versions less than that specified in my Podfile. I'm not sure why that was but I came across a github issue with a fix linked below.
https://github.com/travis-mark/lrn/commit/015854716feadd61a904d5a603b027426472f863
The fix is a post install script that overrides the IPHONEOS_DEPLOYMENT_TARGET with the minimum ios version from the Podfile.
Builds are working now
Assuming
rncore
really is missing in your in yournode_modules/react-native/ReactCommon/react/renderer/components
, then a reference to yournode_modules
in yourios
configuration must be wrong (most likely either in yourPodfile
and/or in your.pbxproj
).For example, the
app_path
argument of myuse_react_native
call in myPodfile
was assigned the value#{Pod::Config.instance.installation_root}/..
. However, as my project is in a monorepo with a singlenode_modules
two folders earlier, I had to change it to#{Pod::Config.instance.installation_root}/../../..
.