384

while building iOS app on Xcode I got these 2 errors, I tried to build the iOS on visual studio code and I got the same errors. the operating system macOS 14.0 beta. processor M1 Pro

errors messages

Could downgrading the operating system fix that issue?

1
  • Useful question, and useful answer - should be reopen Commented May 14 at 18:58

12 Answers 12

1190

In Xcode, go to your project's Build Settings menu. In the Build Options section, set the property ENABLE_USER_SCRIPT_SANDBOXING to 'No'.

Screenshot of Xcode project Build Settings with the 'User Script Sandboxing' option set to 'No'

Sign up to request clarification or add additional context in comments.

10 Comments

this is indeed the correct answer. but why is this needed at all?
rsync 9974 and rsync 9987 went away, but now I have errors for rsync 10090 and 10093 which say: Sandbox: rsync(10090) deny(1) file-write-create /Users/jonathan/Library/Developer/Xcode/DerivedData/Go_Cart-cfpedjquevfpxzaopshdpjedieco/Build/Products/Debug-iphoneos/XCFrameworkIntermediates/Realm/Headers
I have set this to NO and same as @jonathan3087 I still have similar errors .. Sandbox: rsync(37912) deny(1) file-write-create /Users/plasma/Library/Developer/Xcode/DerivedData/RTSPtest-fjamhnfxeyhjfjabnbhpcrctfmth/Build/Products/Debug-iphoneos/XCFrameworkIntermediates/MobileVLCKit/dSYMs Sandbox: rsync(37913) deny(1) file-write-create /Users/plasma/Library/Developer/Xcode/DerivedData/RTSPtest-fjamhnfxeyhjfjabnbhpcrctfmth/Build/Products/Debug-iphoneos/XCFrameworkIntermediates/MobileVLCKit/MobileVLCKit.framework/.MobileVLCKit.izJrf5
@Cesar XCode 15 introduces new 'sandboxing' feature, and recommends it to us in yellow warning mark. Going along with it is detrimental to flutter development however, because 'sandboxing' limits our app's interaction with the OS and access to our storage, which is important in development stage. Sandboxing is only useful for production, IMHO, to protect end user from evil apps. I don't know what where XCode's makers thinking.
Update your Xcode project build option ENABLE_USER_SCRIPT_SANDBOXING to 'No'. this solution is working for me.
|
111

@hasayakey 's answer worked for me, but I wanted to add some extra info about how to find this setting.

To find the 'ENABLE_USER_SCRIPT_SANDBOXING' go to the Search icon tab in the left hand panel within Xcode. Ensure you are searching within the 'Runner' workspace, configured the search to ignore text and then press enter to search with text 'ENABLE_USER_SCRIPT_SANDBOXING'.

In Xcode 14/15, the result should look like this:

Xcode Search Tab

Alternatively, you can navigate to this setting by going to:

Xcode > Project > Runner > Build Settings > Build Options > User Script Sandboxing (near the bottom of build options)

Xcode 15 User Script Sandboxing Location

2 Comments

Anyone know if the App Review folks will flag this fix?
@ICL1901 I have had this setting in multiple app store releases now and it has been fine.
14

I had two targets in my project: Runner, and Flutter Assemble. I had never seen the latter before, so I switched ENABLE_USER_SCRIPT_SANDBOXING to 'No' for them both, and it worked.

Comments

13

In my case, after integration of Cleverpush SDK, I got the issue.

In the iOS project, in the XCode I had to do the next steps:

  1. Tap on 'Runner' in the tree on the left toolbar;
  2. Select 'CleverPushNotificationServiceExtension' in the 'targets' list;
  3. Select 'Building Settings' element on the columns;
  4. Select 'All' & 'Combined';
  5. Filter by 'ENABLE_USER_SCRIPT_SANDBOXING' keyword;
  6. Set the 'User Script Sandboxing' parameter to 'No'.

enter image description here

Comments

11

Turning it off (setting to No) doesn't fix issues for my Flutter project; I got another set of similar errors.

I got the solution following these steps:

  1. Set "User Script Sandboxing" to "No" from Project- > Build Settings
  2. Exit Xcode
  3. run Flutter clean, then Flutter pub get
  4. run pod install from the terminal (inside ios folder)

Comments

9

If you are using React Native make sure to check "User Script Sandboxing" in your Pods project (NOT ONLY the <project name> project). For me it was "Yes" by default.

Xcode project with pods project sandboxing

Comments

5

Ever since the release of a new xcodeproj ruby gem version 1.26.0 on 27th Oct 2024, we started seeing rsync.samba errors on our Xcode projects when we were building using Xcode 15.x.

The solution for this was to explicitly add a version lock to xcodeproj version 1.25.0 in our project's Gemfile.

gem 'xcodeproj', '1.25.0'

Or update to a cocoapods version > 1.16.1:

gem 'cocoapods', '>= 1.16.1'

Post this change we need to run:

  • bundle install to update local gems for this project.
  • bundle exec pod install to regenerate Pods.xcodeproj

(If you are not using Gemfile or bundler to manage gems, check the version of locally installed xcodeproj version using xcodeproj --version. And uninstall the 1.26.0 version using gem uninstall xcodeproj (This uninstallation is only required if we are unable to update to 1.16.1 cocoapod release.))

Why does this help fix the build errors?

  • Cocoapods internally uses the xcodeproj gem to generate a Pods.xcodeproj/project.pbxproj file.
  • xcodeproj 1.26.0 sets the ENABLE_USER_SCRIPT_SANDBOXING setting to YES for most of the Pod targets for Xcode 16 compatibility. (Github PR)
  • By downgrading to 1.25.0 we ensure that this build setting is not set to YES, which helps resolve rsync.samba build errors on Xcode 15.
  • NOTE: If you are already on Xcode 16, it is not recommended to lock xcodeproj gem to 1.25.0 as projects which depend on Cocoapods can start failing.

EDIT:

Cocoapods 1.16.1 release is out as well. Updating to this version should help resolve the issue as well. (Make sure to remove gem 'xcodeproj', '1.25.0' in Gemfile to install this version)

Comments

2

enter image description here

Set “No” to all “User Script Sandboxing” in all targets.

Comments

2

In case ENABLE_USER_SCRIPT_SANDBOXING is already set to NO, and you are still receiving the error, then:

  1. Close Xcode and cd ~/Library/Developer/Xcode/DerivedData in terminal
  2. Remove directory/ies with the project names rm -rf <name>*
  3. Delete Xcode simulators locking the disk: xcrun simctl delete unavailable
  4. cd <project>/ios and pod install
  5. Start Xcode again and build/archive your project

Setting permissions to 777 using chmod, is a no-no and also unnecessary.

Comments

1

A solution for someone who uses CocoaPods as Package manager: To resolve properly without set ENABLE_USER_SCRIPT_SANDBOXING = No, first you need to comment in the Podfile the command use_frameworks!, i.e. leaving it out (in this way you be able to set in Build Phases -> Link Binary with Libraries the libPods-namePod.a instead of namePod.framework) then run pod install and finally build and run.

1 Comment

Worked for me, i did used Swift package manager, then shifted to Podfile due to RxSwift support, and got above issue. Tried "ENABLE_USER_SCRIPT_SANDBOXING = No" but not worked. Then Podfile "use_frameworks!" commenting worked.
0
//:configuration = Debug
ENABLE_USER_SCRIPT_SANDBOXING = NO

//:configuration = Release
ENABLE_USER_SCRIPT_SANDBOXING = NO

//:completeSettings = some
ENABLE_USER_SCRIPT_SANDBOXING

This method worked for me.

1 Comment

Thank you for your interest in contributing to the Stack Overflow community. This question already has quite a few answers—including one that has been extensively validated by the community. Are you certain your approach hasn’t been given previously? If so, it would be useful to explain how your approach is different, under what circumstances your approach might be preferred, and/or why you think the previous answers aren’t sufficient. Can you kindly edit your answer to offer an explanation?
0

In XCode 15.1 I was having same problem.

I deleted Homebrew, and then reinstalled it, reinstalled cocoapods, and then installed pods, and it worked.

1 Comment

How can deleting and reinstalling resolve this problem? I've just installed latest version of Xcode, CocoaPods and all Pods library, but still get error. In my case, so far set the User Script Sanboxing to NO is the solution

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.