Xcode 10 中的 Permission Denied 错误阻止 Build...Command PhaseScriptExecution 失败,退出代码为非零 [英] Permission Denied error in Xcode 10 preventing Build...Command PhaseScriptExecution failed with a nonzero exit code

查看:84
本文介绍了Xcode 10 中的 Permission Denied 错误阻止 Build...Command PhaseScriptExecution 失败,退出代码为非零的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于错误,我无法构建/归档我的项目:

I'm unable to Build/Archive my project due to an error:

权限被拒绝
命令 PhaseScriptExecution 失败,退出代码非零

Permission denied
Command PhaseScriptExecution failed with a nonzero exit code

我已尝试按照其他答案的建议更正钥匙串登录,但没有奏效.请问有人可以帮忙吗?很可能是新手错误,但这意味着我什至无法模拟我的应用程序.

I have tried correcting keychain login as advised by other answers, but it hasn't worked. Please could someone help? Most likely a rookie mistake but means I cannot even simulate my app.

关于错误的更多细节:

PhaseScriptExecution Copy\ Pods\ Resources 

/Users/james/Library/Developer/Xcode/DerivedData/trials-fseuxkwjlleukxdxyfgdrujhdwuy/Build/Intermediates.noindex/trials.build/Debug-iphonesimulator/trials.build/Script-8DEE2FC97BFA0D6E636019C4.sh (in target: trials)
    cd /Users/james/pCloud\ Drive/3.\ NeuroRecovery\ Ltd/4.\ Products/3.\ NIHR\ Trial\ NHS/v1.0\ -\ Initial\ App/1.\ App\ Delivery/3.\ Source\ Code/1.\ iOS/trials
    /bin/sh -c /Users/james/Library/Developer/Xcode/DerivedData/trials-fseuxkwjlleukxdxyfgdrujhdwuy/Build/Intermediates.noindex/trials.build/Debug-iphonesimulator/trials.build/Script-8DEE2FC97BFA0D6E636019C4.sh

/Users/james/Library/Developer/Xcode/DerivedData/trials-fseuxkwjlleukxdxyfgdrujhdwuy/Build/Intermediates.noindex/trials.build/Debug-iphonesimulator/trials.build/Script-8DEE2FC97BFA0D6E636019C4.sh: line 2: /Users/james/pCloud Drive/3. NeuroRecovery Ltd/4. Products/3. NIHR Trial NHS/v1.0 - Initial App/1. App Delivery/3. Source Code/1. iOS/trials/Pods/Target Support Files/Pods-trials/Pods-trials-resources.sh: Permission denied
Command PhaseScriptExecution failed with a nonzero exit code

编辑 12 月 17 日:谢谢@geno-chen &@fantini 我已经检查过 &可以报​​告以下内容:

Edit 17th Dec: thank you @geno-chen & @fantini I have checked & can report the following:

  1. 您是否使用 sudo 安装了 Cocoapods:是的.

  1. Did you install Cocoapods with sudo: Yes.

我使用 ls -lh 检查了文件的权限,结果如下:-rw-r--r-- 1 james 员工 159B 2015 年 3 月 25 日 Podfile-rw-r--r-- 1 名詹姆斯员工 1.2K 2015 年 3 月 25 日 Podfile.lockdrwxr-xr-x 11 詹姆斯工作人员 352B 12 月 17 日 14:03 Podsdrwxr-xr-x 52 詹姆斯工作人员 1.6K 12 月 17 日 14:03 试验drwxr-xr-x@ 5 james 工作人员 160B 12 月 17 日 14:03 trial.xcodeprojdrwxr-xr-x@ 5 james 工作人员 160B 12 月 17 日 14:03 trial.xcworkspacedrwxr-xr-x 4 詹姆斯工作人员 128B 12 月 17 日 14:03 试验测试

I checked the permissions of the files using ls -lh and had the following: -rw-r--r-- 1 james staff 159B 25 Mar 2015 Podfile -rw-r--r-- 1 james staff 1.2K 25 Mar 2015 Podfile.lock drwxr-xr-x 11 james staff 352B 17 Dec 14:03 Pods drwxr-xr-x 52 james staff 1.6K 17 Dec 14:03 trials drwxr-xr-x@ 5 james staff 160B 17 Dec 14:03 trials.xcodeproj drwxr-xr-x@ 5 james staff 160B 17 Dec 14:03 trials.xcworkspace drwxr-xr-x 4 james staff 128B 17 Dec 14:03 trialsTests

我使用 chmod 来修改 podfiles 的权限,如下所示:-rwxr-xr-x 1 詹姆斯工作人员 159B 2015 年 3 月 25 日 Podfile-rwxr-xr-x 1 詹姆斯员工 1.2K 2015 年 3 月 25 日 Podfile.lockdrwxr-xr-x 11 詹姆斯工作人员 352B 12 月 17 日 14:03 Podsdrwxr-xr-x 52 詹姆斯工作人员 1.6K 12 月 17 日 14:03 试验drwxr-xr-x@ 5 james 工作人员 160B 12 月 17 日 14:03 trial.xcodeprojdrwxr-xr-x@ 5 james 工作人员 160B 12 月 17 日 14:03 trial.xcworkspacedrwxr-xr-x 4 詹姆斯工作人员 128B 12 月 17 日 14:03 试验测试

I used chmod to modify permissions of the podfiles as below: -rwxr-xr-x 1 james staff 159B 25 Mar 2015 Podfile -rwxr-xr-x 1 james staff 1.2K 25 Mar 2015 Podfile.lock drwxr-xr-x 11 james staff 352B 17 Dec 14:03 Pods drwxr-xr-x 52 james staff 1.6K 17 Dec 14:03 trials drwxr-xr-x@ 5 james staff 160B 17 Dec 14:03 trials.xcodeproj drwxr-xr-x@ 5 james staff 160B 17 Dec 14:03 trials.xcworkspace drwxr-xr-x 4 james staff 128B 17 Dec 14:03 trialsTests

然后我清理了我的构建文件夹,重新启动但仍然出现相同的错误.

I then Cleaned my Build Folder, restarted but still have the same error.

推荐答案

我通过运行以下命令修复了权限问题.

I fixed the permission problem by running the following command.

chmod +x "Path to .sh"

请将 ProjectName 替换为您的项目名称,将 username 替换为您的用户名

Please replace ProjectName with your project name and username with your username

chmod +x /Users/username/Documents/ProjectName/Pods/Target\ Support\ Files/Pods-ProjectName/Pods-ProjectName-frameworks.sh

您可以从您的 xcode 项目中获取路径,如步骤 1 到 3 所述

You can get the path from your xcode project as explained by step 1 to 3

这篇关于Xcode 10 中的 Permission Denied 错误阻止 Build...Command PhaseScriptExecution 失败,退出代码为非零的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆