Open nvacheishvili opened 1 month ago
:warning: | Missing Reproducible Example |
---|---|
:information_source: | We could not detect a reproducible example in your issue report. Please provide either:
|
I got same error sometimes. Reinstall pods worked for me
I am facing the same issue. Reinstalling Pods didn't work for me.
Hi all @nvacheishvili @steadev and @abhaypithadiya!
In 0.74 there has been a breaking change, for which React-Codegen
has been renamed to ReactCodegen
to avoid the dance for which static libraries are ok with React-Codegen
as a name and frameworks needs React_Codegen
(notice the -
versus the _
).
We also changed a little how we run cocoapods, as Codegen now always runs in both architectures.
The error you linked above, which I paste below, means that your app can't find the FBReactNativeSpec.h
file.
FBReactNativeSpec/FBReactNativeSpec.h: No such file or directory (in target 'React-Codegen' from project 'Pods')
** ARCHIVE FAILED **
The following build commands failed:
Copy /Users/runner/Library/Developer/Xcode/DerivedData/MobileApp-fsljxdyguedfjldkjtihcbwatykp/Build/Intermediates.noindex/ArchiveIntermediates/MobileAppDev/BuildProductsPath/Release-iphoneos/React-Codegen/React_Codegen.framework/Headers/FBReactNativeSpec/FBReactNativeSpec.h /Users/runner/work/MobileApp/MobileApp/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec.h (in target 'React-Codegen' from project 'Pods')
(1 failure)
ERROR [2024-05-30 20:10:15.14]: Exit status: 65
So, some questions to let you unblock yourselves:
I just tried to archive a new app created with 0.74 and the archive step worked fine.
Hey everyone, I resolved this issue in the following way.
I setup the CI with yarn 3.0 (not sure if it did actually have an impact though)
made sure that the runner was on macos-14 building with Xcode 15.4 and ruby 2.7.6
Installed latest cocoapods & updated gemfile in ios using bundle update
Invalidated caches using this script before building:
#!/bin/bash
# Ripped from: https://gist.githubusercontent.com/townofdon/087c7c0bb773adb158f20339c7e13408/raw/53ccb3430cf870c3cdeecead82bc12c3644f2f53/react-native-nuke.sh
# ReactNative script to clean all the things
# usage:
# - add each item below as a separate script in package.json
# - add one final script:
# - "clean": "yarn clean-node-modules && yarn clean-pods && yarn clean-ios && yarn clean-android && yarn clean-rn-cache"
# - alternatively, copy this shell script and add the following cmd to package.json:
# - "clean": "./react-native-clean-sh"
# - you may need to run `sudo chmod 777 ./react-native-clean-sh before this script can run`
echo " ____ "
echo " __,-~~/~ \`---. "
echo " _/_,---( , ) "
echo " __ / < / ) \___ "
echo " ====------------------===;;;== "
echo " \/ ~\"~\"~\"~\"~\"~\~\"~)~\",1/ "
echo " (_ ( \ ( > \) "
echo " \_( _ < >_>' "
echo " ~ \`-i' ::>|--\" "
echo " I;|.|.| "
echo " <|i::|i|> "
echo " |[::|.| "
echo " ||: | "
echo "______________________REACT NATIVE CLEAN ALL________________ "
# clean-node-modules
echo "____________________________________________________________"
echo "About to clean node_modules"
rm -rf node_modules
echo "Done cleaning node_modules"
echo "____________________________________________________________"
# clean-pods
echo "____________________________________________________________"
echo "About to clean pods and reinstall them"
cd ios && rm -rf Pods && cd ..
echo "Done cleaning pods"
echo "____________________________________________________________"
#reinstall node_modules
echo "____________________________________________________________"
echo "About to install node_modules"
npm install --legacy-peer-deps
echo "Done installing node_modules"
echo "____________________________________________________________"
# clean-ios
echo "____________________________________________________________"
echo "About to clean the builds for iOS"
rm -rf ios/build && rm -rf ~/Library/Developer/Xcode/DerivedData && rm -rf ./ios/DerivedData
echo "Done cleaning builds for iOS"
echo "____________________________________________________________"
#reinstall pods
echo "____________________________________________________________"
echo "About to install pods"
cd ios && pod deintegrate && pod install && pod install --repo-update && cd ..
echo "Done installing pods"
echo "____________________________________________________________"
# clean-rn-cache
echo "____________________________________________________________"
echo "About to clean rn cache"
rm -rf $TMPDIR/react-* && rm -rf $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-*
echo "Done cleaning rn cache"
echo "____________________________________________________________"
Hey Guys! I am new to App Development so I don't have much knowledge about this.
I installed the latest version using npx react-native@latest init AwesomeProject
. Later it asked me if i want to install cocopods to which I responded yes. I am using 1.15.2
version.
After everything was installed. I did npx react-native run-ios
in the project directory.
And I got the below error.
Command PhaseScriptExecution failed with a nonzero exit code
warning: Run script build phase '[CP-User] [Hermes] Replace Hermes for the right configuration, if needed' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'hermes-engine' from project 'Pods')
warning: Run script build phase 'Bundle React Native code and images' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'AwesomeProject' from project 'AwesomeProject')
warning: Run script build phase '[CP-User] [RN]Check rncore' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'React-Fabric' from project 'Pods')
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:iOS Simulator, id:77BDA196-C250-483C-BD03-8BBAF144CB78, OS:17.4, name:iPhone SE (3rd generation) }
{ platform:iOS Simulator, id:77BDA196-C250-483C-BD03-8BBAF144CB78, OS:17.4, name:iPhone SE (3rd generation) }
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution [CP-User]\ Generate\ Specs /.../AwesomeProject-frwntmzqjfbbtpebzntqavmomgxa/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-Codegen.build/Script-46EB2E00012AD0.sh (in target 'React-Codegen' from project 'Pods')
(1 failure)
My Ruby Version is ruby 2.6.10p210
and node Version is v22.1.0
@abhaypithadiya sorry for the late reply. Have you solved the issue? The problem could be that your node is properly setup.
.xcode.env.local
file?command -v node
?Hey @cipolleschi! I couldn't solve the issue yet. The content in .xcode.env.local
is same as the output which comes when i run command -v node
. Both of them match.
I'm also getting this issue with a clean installation and new project. I have no idea how to resolve it!
@abhaypithadiya - I resolved my issue, it ended up being I had the project in a parent folder with a space "Expo Test", changed to "ExpoTest" and everything built!
Hey @papaytl185! Thankyou for your reply! But I am not using Expo, and I just copy pasted the code from the documentation so it is just AwesomeProject. So there is no space and it is in the root level not inside any folders.
@cipolleschi I run into this issue when building using static frameworks.
From which library the error come from? React-Codegen
Are you building with the New Architecture or the Old Architecture? New Architecture
I am using RN 0.74.2 - is it expected that ReactCodegen should be installed instead of React-Codegen on this version? Because for me it is always React-Codegen
Hope this helps, thanks!
I am using RN 0.74.2 - is it expected that ReactCodegen should be installed instead of React-Codegen on this version? Because for me it is always React-Codegen
Yeah, you are right. I mixed up versions. We moved from React-Codegen
to ReactCodegen
in 0.75, not 0.74. I misremembered when I replied above.
I'm trying to repro the issue:
npx react-native@0.74.2 init RN0742 --version 0.74.2 --skip-install
cd RN0742
yarn
cd ios
bundle install
USE_FRAMEWORKS=static RCT_NEW_ARCH_ENABLED=1 bundle exec pod install
cd ..
yarn ios
It builds and run for me.
There should be some other library that is making it fail.
Can you provide a reproducer using this template, please?
Hello @cipolleschi! i tried making a reproducer, please check it out: https://github.com/abhaypithadiya/react-native-test. I get the yarn error but i am not using yarn. When I try to build the ios app I still get this error:
PhaseScriptExecution [CP-User]\ Generate\ Specs /Users/.../Xcode/DerivedData/AwesomeProject-exerqpxetpbwwdampafvvsyirlxo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-Codegen.build/Script-46EB2E00012AD0.sh (in target 'React-Codegen' from project 'Pods')
Hope this helps!
@abhaypithadiya what's the content of your .xcode.env.local
?
Also, what happen if you build from Xcode instead of with CLI?
The content of .xcode.env.local is:
export NODE_BINARY=/opt/homebrew/bin/node
.
If I build from Xcode I get the same error.
@cipolleschi
I am facing the same issue. I am also on Rn version 0.74 with xcode 15.3.
When building the app using fastlane I get: `e script phase. (in target 'RCT-Folly' from project 'Pods') ARCHIVE FAILED
The following build commands failed: Copy /Users/.../Library/Developer/Xcode/DerivedData/App-gwezcvnfaoafftbtwlztzpvcrteg/Build/Intermediates.noindex/ArchiveIntermediates/App/BuildProductsPath/Release-iphoneos/React-Codegen/React_Codegen.framework/Headers/FBReactNativeSpec/FBReactNativeSpec.h /Users/.../apps/app-app/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec.h (in target 'React-Codegen' from project 'Pods') (1 failure) [11:05:50]: Exit status: 65`
Hi everyone,
I was facing the same issue and spent two days thinking it was related to Xcode 15.3, React Native 0.74.3 and React-Codegen. After some investigation, I found the real problem.
If your app is in a directory that contains spaces, this error might occur. For example, my project was inside /React Native/AwesomeProject. I simply changed it to /React-Native/AwesomeProject, and the issue was resolved.
After changing the directory name, follow these steps:
I hope this helps save someone else time!
@abhaypithadiya see if this solution works for you.
Description
I have upgraded to latest react native and I am able to build everything fine locally, while CI keeps throwing this error on build:
FBReactNativeSpec/FBReactNativeSpec.h: No such file or directory (in target 'React-Codegen' from project 'Pods')
ARCHIVE FAILED
The following build commands failed: Copy /Users/runner/Library/Developer/Xcode/DerivedData/MobileApp-fsljxdyguedfjldkjtihcbwatykp/Build/Intermediates.noindex/ArchiveIntermediates/MobileAppDev/BuildProductsPath/Release-iphoneos/React-Codegen/React_Codegen.framework/Headers/FBReactNativeSpec/FBReactNativeSpec.h /Users/runner/work/MobileApp/MobileApp/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec.h (in target 'React-Codegen' from project 'Pods') (1 failure) ERROR [2024-05-30 20:10:15.14]: Exit status: 65
Steps to reproduce
N/A
React Native Version
0.74.1
Affected Platforms
Runtime - iOS, Build - MacOS
Areas
Codegen
Output of
npx react-native info
Stacktrace or Logs
Reproducer
N/A
Screenshots and Videos
No response