7

I'm getting these errors when building my project in Xcode after installing mapbox:

error: Sandbox: rsync.samba(76010) deny(1) file-write-create /Users/lluis/Library/Developer/Xcode/DerivedData/MyProject-dlpddtwcucwpygcxhthjwisifahq/Build/Products/Debug-iphonesimulator/MyProject-Des.app/Frameworks/MapboxMaps.framework/MapboxMapsResources.bundle (in target 'MyProject-Des' from project 'MyProject')
error: Sandbox: rsync.samba(76011) deny(1) file-write-create /Users/lluis/Library/Developer/Xcode/DerivedData/MyProject-dlpddtwcucwpygcxhthjwisifahq/Build/Products/Debug-iphonesimulator/MyProject-Des.app/Frameworks/MapboxMaps.framework/.Info.plist.7j5Zxx (in target 'MyProject-Des' from project 'MyProject')
error: Sandbox: rsync.samba(76011) deny(1) file-write-create /Users/lluis/Library/Developer/Xcode/DerivedData/MyProject-dlpddtwcucwpygcxhthjwisifahq/Build/Products/Debug-iphonesimulator/MyProject-Des.app/Frameworks/MapboxMaps.framework/.MapboxMaps.rIRQea

I have tried with ChatGPT and checked lots of different places such as the following links: https://stackoverflow.com/questions/76590131/error-while-build-ios-app-in-xcode-sandbox-rsync-samba-13105-deny1-file-w https://forums.developer.apple.com/forums/thread/759995 https://www.youtube.com/watch?v=MoR-vopM1HY https://forums.developer.apple.com/forums/thread/708282 https://stackoverflow.com/questions/77660771/understanding-build-error-xcode-sandbox-bash30970-deny1-file-read-data

All of them end up with the same solution: setting ENABLE_USER_SCRIPT_SANDBOXING to NO. And it seems to me that there's no other real solution on the net. I've followed all the instructions, setting ENABLE_USER_SCRIPT_SANDBOXING to NO, and clean up my project every time:

rm -rf ~/Library/Caches/CocoaPods
rm -rf ios/Pods
rm -rf ios/Podfile.lock
rm -rf ~/Library/Developer/Xcode/DerivedData/*
cd ios
pod deintegrate
pod setup
pod install --repo-update

Although it actually worked for me, I was wondering if there was another work around while leaving ENABLE_USER_SCRIPT_SANDBOXING to YES.

I understand this error happens in the building process when Xcode is trying to write files in a forbidden location, but I really don't get why this error should be happening at all.

I'm using the latest versions for ruby, Cocoapods, npm, Xcode, React-native, react-native-config, @rnmapbox/maps, firebase, etc.

Could it be that there is some sort of issue with these versions combined? Should I downgrade some of these components versions? Should I "tamper" with my building phases?

I'm using ruby "3.3.0", Xcode 15.4. The sistem is using Cocoapods 1.15.2 although my Gemfile looks like this:

source 'https://rubygems.org'

# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby "3.3.0"

# Cocoapods 1.15 introduced a bug which break the build. We will remove the upper
# bound in the template on Cocoapods with next React Native release.
gem 'cocoapods', '>= 1.13', '< 1.15'
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'

Maybe this comment (# Cocoapods 1.15 introduced a bug which break the build. We will remove the upper bound in the template on Cocoapods with next React Native release.) is the key?

This is MyPodfile:

# Resolve react_native_pods.rb with node to allow for hoisting
require Pod::Executable.execute_command('node', ['-p',
  'require.resolve(
    "react-native/scripts/react_native_pods.rb",
    {paths: [process.argv[1]]},
  )', __dir__]).strip

platform :ios, min_ios_version_supported
prepare_react_native_project!

linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
  Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
  use_frameworks! :linkage => linkage.to_sym
end

target 'MyProject' do
  config = use_native_modules!

use_frameworks! :linkage => :static # Added following instructions for Firebase https://rnfirebase.io/#altering-cocoapods-to-use-frameworks
$RNFirebaseAsStaticFramework = true # Added following instructions for Firebase https://rnfirebase.io/#altering-cocoapods-to-use-frameworks

  use_react_native!(
    :path => config[:reactNativePath],
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )
  target 'MyProject-Des' do
    inherit! :complete
  end
  target 'MyProject-Pre' do
    inherit! :complete
  end

  # MAPBOX START
  pre_install do |installer|
  $RNMapboxMaps.pre_install(installer)
  end
  # MAPBOX END

  post_install do |installer|
    # https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
    react_native_post_install(
      installer,
      config[:reactNativePath],
      :mac_catalyst_enabled => false,
      # :ccache_enabled => true
    )
    # MAPBOX START
    $RNMapboxMaps.post_install(installer)
    # MAPBOX END
  end
end

Thanks a lot in advance!

1
  • Did you find a different way to solve it? I'm facing the same Sandbox: rsync.samba to build my iOS product after macOS Sequoia upgrade. Even after downgrading Xcode to 15 and checking the versions of all the rest, the problem is here. Unfortunately ENABLE_USER_SCRIPT_SANDBOXING is already NO without success for my problem. Commented Oct 30, 2024 at 17:32

1 Answer 1

0

I ran into the same issue and managed to fix it by doing the following:

  1. Click on the Project Name Go into the Build Settings

  2. Find Build Options: Look for the Build Options section—it’s usually where you tweak things related to how your project gets built.

  3. Change the Setting: There should be an option you can toggle, like switching it from Yes to No

  4. Rebuild the Project: Save your changes and rebuild the project to see if it works.

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

2 Comments

That's the solution the OP is referring to. They are asking if there is a different one.
@prolific8 have you solved this problem instead of set NO to User Script Sandboxing?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.