Repository navigation
Description
Description
Hi Guys, I'm trying to perform an archive using 0.71.5 but I'm getting an error.
The error occurs in Build phase "[CP] Embed Pods Frameworks", when he runs the script with:
"${PODS_ROOT}/Target Support Files/Pods-MyApp/Pods-MyApp-frameworks.sh"
React Native Version
0.71.5
Output of npx react-native info
System:
OS: macOS 13.3
CPU: (8) arm64 Apple M1
Memory: 79.22 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 16.13.1 - ~/.nvm/versions/node/v16.13.1/bin/node
Yarn: 1.22.17 - ~/.nvm/versions/node/v16.13.1/bin/yarn
npm: 8.1.2 - ~/.nvm/versions/node/v16.13.1/bin/npm
Watchman: 2022.11.14.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.11.3 - /Users/leonardo.felipe/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4
Android SDK:
API Levels: 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33
Build Tools: 29.0.2, 30.0.2, 30.0.3, 31.0.0, 32.0.0, 32.1.0, 33.0.0
System Images: android-32 | Google APIs ARM 64 v8a, android-33 | Google APIs ARM 64 v8a
Android NDK: 22.1.7171670
IDEs:
Android Studio: 2021.2 AI-212.5712.43.2112.8609683
Xcode: 14.3/14E222b - /usr/bin/xcodebuild
Languages:
Java: 11.0.14.1 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.2.0 => 18.2.0
react-native: 0.71.5 => 0.71.5
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
Steps to reproduce
- Create a project in 0.71.5
- Try to perform an archive
- Archive will fail in build phase "[CP] Embed Pods Frameworks"
Snack, code example, screenshot, or link to a repository
Investigating the problem I noticed that the problem occurs in the "Symlinked..." of the script Pods-MyApp-frameworks.sh
if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink "${source}")"
fi
Workaround is to update all the generated ...-frameworks.sh files to add the -f flag to the call to readlink. In other words, replace
source="$(readlink "${source}")"
with
source="$(readlink -f "${source}")"
The Workaround above was suggested for the issue below and has now been merged into the cocoapods repository.
I believe we will need an RC with this FIX pointing to the new version of cocoapods as soon as it is released.
Activity
netvalue-emursali commentedon Apr 3, 2023
Having the same issue. Apple M2 Pro, Xcode 14.3.
JacobFJ commentedon Apr 3, 2023
+1
Daha62 commentedon Apr 3, 2023
+1
milind-betaflux commentedon Apr 3, 2023
Facing the same issue.
rsync error: some files could not be transferred (code 23) at /AppleInternal/Library/BuildRoots/97f6331a-ba75-11ed-a4bc-863efbbaf80d/Library/Caches/com.apple.xbs/Sources/rsync/rsync/main.c(996) [sender=2.6.9]
Command PhaseScriptExecution failed with a nonzero exit code
UPDATE
adding '-f' on the highlighted line in this file resolved my issue. You can try this
kelset commentedon Apr 3, 2023
duplicate of #36739
leofolive commentedon Apr 3, 2023
@kelset
I believe that although this question deals with an error in the same build phase, it seems to me that it pertains to different matters.
The patch reported in the problem you cited, does not solve my problem.
I had a very strange issue where the pods frameworks script would fail to copy the framework files when archiving a build (building worked fine).
johnsoncwb commentedon Apr 3, 2023
@kelset
can you check again this error?
it looks different for me from #36739
kelset commentedon Apr 3, 2023
re opening - but it looks like it's not a react-native problem, but cocoapods, so not really anything we can do about it CocoaPods/CocoaPods#11828 --- I'll pass it along
StefanWallin commentedon Apr 3, 2023
While trying to upgrade step by step from 0.69.1 to 0.71.5 step by step I have not gotten fastlane to build the latest week. iOS simulator runs fine.
I have applied the target deployment version patch and set my Gemfile for
which resolves to CocoaPods/CocoaPods@3ac99be.
Given these changes a clean out and pod-reinstall I'm still seeing symlink issues after running this darling command:
from the ios folder.
The log output from fastlane is saying:
Which to me clearly indicates a still present symlink issue. Are we still convinced this is a cocoapods-issue or how RN uses cocoapods or the script?
I'm happy to move this issue to the cocoapods-repo but it seems to me it might be due to some internal use in
DoubleConversion?Also, cocoapods does not accept issues with RN/Flutter, as per their new issue template. I am not sure where to start to make this a reproducible issue without RN.
salamohamad commentedon Apr 3, 2023
148 remaining items
kjgetcarnera commentedon Mar 26, 2025
Solution That Worked for Me:
The problem was caused by a stale .xcode.env.local file that pointed to a removed Node.js version.
Steps to Fix:
Delete the .xcode.env.local file:
rm ~/.xcode.env.local
Reinstall dependencies and clean the project:
cd ios
rm -rf Pods Podfile.lock
pod install
cd ..
Clean and rebuild the project:
npx react-native run-ios
Why This Works:
.xcode.env.local stores environment variables and can contain outdated paths for Node.js after an upgrade.
Deleting it allows Xcode to use the correct Node.js path.
aanom commentedon May 5, 2025
update node path at .xcode.env.local file
Step 1: Write
which nodeat terminal to check your node pathStep 2: Update .xcode.env.local with node path at NODE_BINARY
ex- export NODE_BINARY=/opt/homebrew/bin/node
tanvihang commentedon May 7, 2025
This error also occur if the .env file format have error, so be sure to check it out. I ended up spending a lot of time finding this, hope this will help someone!
Also checking the Build log error will help alot!
ngothanhtai commentedon May 13, 2025
from a warning message when running Xcode will set NODE_BINARY with current node version:
izaanjahangir commentedon May 18, 2025
Thanks, worked for me
kapilw360 commentedon May 19, 2025
Thanx Buddy. :)
sundansharma commentedon Jun 30, 2025
Go to your iOS folder:
cd iosCreate a file named:
.xcode.env.local
Open Terminal and run:
Jonathan0wh commentedon Jul 16, 2025
Deleting
.xcode.env.localworks for me because the absolute path in this file pointed to an older version of Node that I uninstalled before. Not sure why the path in this file was not automatically updated.Heltonphg commentedon Jul 23, 2025
If you're using nvm, use the following in .xcode.env:
Where 'v.*' refers to the Node.js version you want to use.
For example, if you want to use Node.js version 20, run:
gomdolkim commentedon Jul 24, 2025
It works finally after changing it from nvm to brew for node.
rs3934 commentedon Aug 12, 2025
See the comments, for flutterfire its worked for me: https://fluttertpoints.com/flutter-interview-questions#comment-745
bogamythrai commentedon Sep 30, 2025
✅ Adding
export NODE_BINARY=$(command -v node)to my react native shell scripts under Build Phases (XCode) worked for me.cuba213 commentedon Oct 22, 2025
What worked for me was deleting
.xcode.env.localfile and doing a freshpod installThis is because the node version in the file differed with my system installed node version.
hasnainalimj commentedon Jan 6, 2026
Worked for me after deleting the
.xcode.env.localfile.