Sandbox file-write-create errors after the xcodeproj gem was auto updated to 1.26.0

This is affecting mainly React Native projects but native projects that use Cocoapods may be affected too.

A typical error when building the iOS app is
error: Sandbox: rsync.samba(76606) deny(1) file-write-create /Users/tylerwilliams/Library/Developer/Xcode/DerivedData/PlainRN-dolxtgnoeodnpofjdcgzfoepsrdp/Build/Products/Debug-iphonesimulator/XCFrameworkIntermediates/hermes-engine/Pre-built/hermes.framework/.Info.plist.PNqVDm (in target 'hermes-engine' from project 'Pods')

The solution is to pin the last working version of the xcodeproj gem in your Gemfile
gem 'xcodeproj', '1.25.1' until the xcodeproj gem is updated with a fix
https://github.com/CocoaPods/Xcodeproj/issues/989

The React Native issue is https://github.com/facebook/react-native/issues/47228

4 Likes

Didn’t work for me when I tried:

ruby '3.0.0'

gem 'cocoapods', '1.16.0'
gem 'xcodeproj', '1.25.1'

Hi @SaadWaheed , I am very sorry to hear that this issue has not been resolved for you, most of the feedback we are hearing from users is that pinning those versions work however some customers have found that even with pinning those versions, a framework may sometimes be managing those gems directly and bypasses what they pinned, for this one of my customer tried to handled this at the CI level with a script step right before the failing step but after their dependecy installation and it worked for them

An alternative approach that worked for one of my customers is to try and handle this at the CI level with a script, they had to uninstall some other versions that their framework was trying to manage that had those bad gems, it wasnt something they could just change on their code so they used this:

echo "Starting - Gem updates"
sudo gem uninstall xcodeproj -v 1.22.0 -x --ignore-dependencies
sudo gem uninstall xcodeproj -v 1.26.0 -x --ignore-dependencies
sudo gem install xcodeproj -v 1.25.1
echo "Ending - Gem updates"

You would want to edit the script to uninstall any of the versions that the framework may be installing