[Swift]pod install成功后运行项目报错问题error: Sandbox: bash(84760) deny(1)

操作:

bash 复制代码
platform :ios, '14.0'

target 'ZKMKAPP' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for ZKMKAPP
  pod 'Moya'

end

pod install成功后运行报错

报错:

error: Sandbox: bash(84760) deny(1) file-write-create /Users/gamin/Documents/jiruan/ZKMKAPP/Pods/resources-to-copy-ZKMKAPP.txt (in target 'ZKMKAPP' from project 'ZKMKAPP')

/Users/gamin/Documents/jiruan/ZKMKAPP/Pods/Target Support Files/Pods-ZKMKAPP/Pods-ZKMKAPP-resources.sh: line 20: /Users/gamin/Documents/jiruan/ZKMKAPP/Pods/resources-to-copy-ZKMKAPP.txt: Operation not permitted

realpath: illegal option -- m

usage: realpath [-q] [path ...]

:20: error: Unexpected failure

解决:

在Xcode中,前往项目的"Build Settings"部分,将属性设置ENABLE_USER_SCRIPT_SANDBOXING设置为"No"。

相关:

在 Swift 或 Xcode 项目中,ENABLE_USER_SCRIPT_SANDBOXING 是一个用于控制 用户脚本沙盒化 的构建配置选项。它主要与 Xcode 的脚本执行环境有关,目的是提高构建脚本的安全性,防止脚本对系统或文件进行未经授权的操作。

ENABLE_USER_SCRIPT_SANDBOXING 默认值

  • Xcode 14 及以上版本
    • 默认值为 YES
    • 用户脚本被限制在沙盒环境中运行。
  • Xcode 14 以下版本
    • 此选项默认不存在,脚本运行没有沙盒限制。
相关推荐
TouchWorld2 天前
iOS逆向-哔哩哔哩增加3倍速播放(2)-[横屏视频-半屏播放]增加3倍速播放
ios·swift
1024小神2 天前
xcode 中配置AR Resource Group并设置图片宽度等
ios·swiftui·ar·xcode·swift
Wcowin2 天前
OneClip 开发经验分享:从零到一的 macOS 剪切板应用开发
mac·swift·粘贴板
崽崽长肉肉2 天前
Swift中的知识点总结
ios·swift
代码不行的搬运工2 天前
面向RDMA网络的Swift协议
开发语言·网络·swift
大熊猫侯佩3 天前
拯救发际线行动:用 Swift 和 Image Playground 驾驭 AI 绘图
人工智能·ai·文生图·swift·图生图·imageplayground·apple 智能
linweidong3 天前
网易ios面试题及参考答案(下)
objective-c·swift·ios开发·切面编程·ios面试·苹果开发·mac开发
大熊猫侯佩4 天前
Swift 迭代三巨头(下集):Sequence、Collection 与 Iterator 深度狂飙
swift·编程语言·apple
大熊猫侯佩4 天前
Swift 迭代三巨头(中集):Sequence、Collection 与 Iterator 深度狂飙
swift·编程语言·apple
大熊猫侯佩4 天前
Swift 迭代三巨头(上集):Sequence、Collection 与 Iterator 深度狂飙
swift·编程语言·apple