Closed hsjoberg closed 1 week ago
From what I have tested, when running npx react-native@latest init test_project3 --version 0.74.1
, if you do not install CocoaPods when prompted here ? Do you want to install CocoaPods now? Only needed if you run your project in Xcode directly › (y/N)
, the build will fail with the error above. Could you try this on your end?
Okay I think I've figured it out.
There's an erroneous script [CP-User] [RN]Check rncore
that runs for the React-Fabric pod.
The script tries to look for codegen files in node_modules/react-native/...
, whereas codegen will create them in node_modules/react-native-macos/...
.
The script:
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
$REACT_NATIVE_PATH
will point to react-native
, not react-native-macos
.
This would also explain why it worked for you @morukutsu when you ran the initial pod install
for iOS.
As a quick fix it's possible to just clear out the script and xcode will build the project just fine. You can find the script in Xcode, under Pods -> React Fabric and then Build Phases.
But the actual proper fix is not clear to me yet.
Thanks for the investigation @hsjoberg !
Closing this one. Seems to not be an issue anymore in react-native-macos@0.75.2 💯
Environment
Steps to reproduce the bug
I tried making a fresh project through community cli, and adding react-native-macos to it through
react-native-macos-init
. However, building fails with the following error:I tried both old and new arch.
Steps to reproduce:
npx @react-native-community/cli init rnmacos74 --version 0.74.5
cd rnmacos74
yarn add "react-native-macos@0.74.1"
, workaround of #2152, as described in #2164npx react-native-macos-init --version 0.74.1
macos/Podfile
>You can find reproducible project here: https://github.com/hsjoberg/rnmacos74
Running through cli (
npx react-native-macos run-macos --scheme rnmacos74-macOS --configuration Debug
) does unfortunately not give any more useful info from what I can tell. But I uploaded full log here: https://gist.github.com/hsjoberg/0145ebdf2fa5d7ab138c928222f41b09Expected Behavior
App should successfully build.
Actual Behavior
Getting error
Codegen did not run properly in your project. Please reinstall cocoapods with `bundle exec pod install`.
Reproducible Demo
https://github.com/hsjoberg/rnmacos74
Additional context
No response