Pods-resources.sh 权限在 iOS 项目中被拒绝

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19687033/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 02:40:44  来源:igfitidea点击:

Pods-resources.sh Permission denied in iOS Project

iospermission-deniedxcode5.0.1

提问by Tasnim Alam Shovon

I have got an existing project from a client and I tried to run this in my MAC using XCode 5.0

我有一个来自客户端的现有项目,我尝试使用 XCode 5.0 在我的 MAC 中运行它

But I am facing this following error. I installed Cocoa Pods but still doesn't work. This project is running fine in other developer's machine. I badly need this running in my machine.

但我正面临以下错误。我安装了 Cocoa Pods,但仍然无法正常工作。该项目在其他开发人员的机器上运行良好。我非常需要它在我的机器上运行。

What I am missing? Any help is highly appreciated.

我缺少什么?任何帮助都受到高度赞赏。

Thanks in advance.

提前致谢。

enter image description here

在此处输入图片说明

回答by Kevin

You need to make the script executable. Open terminal and execute this command:

您需要使脚本可执行。打开终端并执行以下命令:

chmod a+x "/Users/shovon0203/Desktop/My Work/oDesk/momenTOGO/MomenTOGO_iPhone/Pods/Pods-resources.sh"

回答by iTALIYA

Try this, Works like a charm!

试试这个,就像一个魅力!

rm -rf Pods/ Podfile.lock
pod install

回答by brycejl

Running pod installin the main project directory where your podfile is located should solve the problem

pod install在你的podfile所在的主项目目录下运行应该可以解决问题

回答by Amardeep puvar

You need to make the script executable. Open terminal and execute this command:

您需要使脚本可执行。打开终端并执行以下命令:

chmod a+x "your_path(where show permission denied)"

Please check if there no any space in folder name then add '\' before

请检查文件夹名称中是否有空格,然后在前面添加“\”

回答by Mike Keskinov

Just remove the folder Pods-[Your_Project_Name]completely and do fresh pod install

只需Pods-[Your_Project_Name]完全删除文件夹并重新做pod install

回答by tentmaking

The above answer works. However, I had the same issue, but it was recurring. It dealt with having the same branch checked-out on multiple machines. It would work on one machine, and not the others. We use TFS as our source control (it's ok, you can judge), which does not play nicely with .sh, .py, etc. files. We had to add a .tpattributesfile to every directory with a .shor .pyfile in it so we could run .shand .pyfiles as executables.

上面的答案有效。但是,我遇到了同样的问题,但它反复出现。它处理在多台机器上签出相同的分支。它可以在一台机器上工作,而不是其他机器。我们使用TFS作为我们的源代码控制(这是确定的,你可以判断),不与发挥很好.sh.py等文件。我们有一个添加.tpattributes文件到每个目录用.sh.py在它的文件,所以我们可以运行.sh.py文件的可执行文件。

Entries in the .tpattributesfile looks like this:

.tpattributes文件中的条目如下所示:

Pods-MyTarget-frameworks.sh:x
Pods-MyTarget-resources.sh:x

This translates to chmod +x "Pods-MyTarget-frameworks.sh"

这转化为 chmod +x "Pods-MyTarget-frameworks.sh"

Works like a charm!

奇迹般有效!

回答by Odwori

This steps worked for me after failing many times.

在多次失败后,这些步骤对我有用。

STEP 1: Navigate to the location of the folder containing Pods-resources.sh

步骤 1:导航到包含 Pods-resources.sh 的文件夹的位置

STEP 2: Open the terminal type cd and then drag the folder containing Pods-resources.sh to terminal and hit enter.

STEP 2: 打开终端类型 cd ,然后将包含 Pods-resources.sh 的文件夹拖到终端并回车。

STEP 3: the run this command>> chmod a+x Pods-resources.sh

第 3 步:运行此命令>> chmod a+x Pods-resources.sh

STEP 4: restart xcode and open your xxx.xworkspace

第 4 步:重新启动 xcode 并打开您的 xxx.xworkspace

STEP 5: enjoy

第5步:享受

回答by CantThinkOfAnything

I posted this as a comment to Kevins answer https://stackoverflow.com/a/19687227/3114383. But I thought I might as well put it as an answer because people will find it easier like this and it solved my problem. It might work for others aswell :D

我将此作为对 Kevins 回答https://stackoverflow.com/a/19687227/3114383的评论发布。但我想我不妨把它作为一个答案,因为人们会发现这样更容易,它解决了我的问题。它可能也适用于其他人:D

I tried running the chmod command from kevins answer and it didnt work. Then i tried the command with sudo which also didnt work. Then i added a User-defined-setting to the build settings in xcode "PODS_ROOT = ${PROJECT_DIR}/Pods/". This is what fixed it for me. It seems the Permission denied error was quite misleading because the script was actually not able to find the file.

我尝试从 kevins answer 运行 chmod 命令,但没有奏效。然后我用 sudo 尝试了这个命令,但也没有用。然后我在 xcode "PODS_ROOT = ${PROJECT_DIR}/Pods/" 的构建设置中添加了一个用户定义的设置。这就是为我修复它的原因。似乎 Permission denied 错误非常具有误导性,因为脚本实际上无法找到该文件。

回答by Saneesh

I have also faced this issue. What I've done is:

我也遇到过这个问题。我所做的是:

  1. Create a brand new project with same name and same package name
  2. In the terminal of the project directory Pod init
  3. Open the pod file in a editor
  4. Copy and paste the old project pod files into the new one
  5. Copy?all?files and resources to the new project
  6. Simply do pod install
  1. 创建一个具有相同名称和相同包名称的全新项目
  2. 在项目目录下终端 Pod init
  3. 在编辑器中打开 pod 文件
  4. 将旧的项目 pod 文件复制并粘贴到新的项目中
  5. 将所有文件和资源复制到新项目
  6. 简单地做 pod install

回答by Dilmurat Abduqayyum

I've faced same problem with Pods-project-frameworks.sh, resolved by removing first line #!/bin/shfrom Pods-project-frameworks.sh file.

我在 Pods-project-frameworks.sh 遇到了同样的问题,通过#!/bin/sh从 Pods-project-frameworks.sh 文件中删除第一行来解决。