99

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

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.

What I am missing?

enter image description here

starball
  • 20,030
  • 7
  • 43
  • 238
Tasnim Alam Shovon
  • 1,149
  • 1
  • 8
  • 12

15 Answers15

193

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"
Kevin
  • 53,822
  • 15
  • 101
  • 132
  • 3
    your command works but not from Terminal :P, i edit the pods script and use the above command and now its working :) thanks dude! – Waqas Haider Sheikh Jun 29 '15 at 19:16
  • 1
    This happens to me when I start a new project, install pods on my home computer then continue the project on my laptop. Is there any way to set the frameworks.sh default permission so I won't have to do this in the terminal everytime I transfer my project between my home and work computers? Thanks – aresz Dec 09 '16 at 02:09
  • 6
    Running the above command along with "sudo" resolved the issue. – Saikiran Komirishetty May 04 '17 at 06:09
  • Since I'm using Subversion with my project this was only a temporary solution because when any other person would initially check out this file, the execute rights would be lost again. use `svn propset svn:executable '*' ` to fix this. – ndreisg Aug 25 '17 at 12:32
  • I tried this command 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. – CantThinkOfAnything Jan 31 '18 at 09:22
  • This, @Kevin, saved my life. I've worked on an app for 6 month and switched to a new MacBook Pro. Suddenly that "permission denied" thing popped up and this did the job. Thank you! – Aeger Aug 30 '18 at 15:01
  • I was facing same issue in my Azure Dev Ops pipeline and finally fix it by adding this command in my pre-build script, Thanks @kevin you saved my day – M David Nov 30 '21 at 07:49
  • Still works with terminal! – user979331 Apr 22 '22 at 01:53
59

Try this, Works like a charm!

rm -rf Pods/ Podfile.lock
pod install
iTALIYA
  • 972
  • 8
  • 14
23

for me deintegrating all pods then reinstalling them did the trick:

pod deintegrate
pod install
18

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

brycejl
  • 1,411
  • 17
  • 22
15

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

Amardeep puvar
  • 155
  • 1
  • 4
9

This steps worked for me after failing many times.

STEP 1: Navigate to the location of the folder containing 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 3: the run this command>> chmod a+x Pods-resources.sh

STEP 4: restart xcode and open your xxx.xworkspace

STEP 5: enjoy

Odwori
  • 1,460
  • 13
  • 14
  • 2
    After long searching about this issue, this one works perfectly in my case. One correction is when run the command then please follow this: chmod a+x Pods-ProjectName-resources.sh – Mohd Sadham Jun 26 '20 at 02:55
  • Good to hear, nice coding. – Odwori Jun 27 '20 at 03:15
7

You could try this:

pod deintegrate && pod cache clean --all && rm -rf Podfile.lock
pod install

It always works well in my projects.

Andres Paladines
  • 1,142
  • 14
  • 19
6

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

Mike Keskinov
  • 11,614
  • 6
  • 59
  • 87
3

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 .tpattributes file to every directory with a .sh or .py file in it so we could run .sh and .py files as executables.

Entries in the .tpattributes file looks like this:

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

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

Works like a charm!

tentmaking
  • 2,076
  • 4
  • 30
  • 53
  • where you've placed: `.tpattributes` file ? – el.severo Jun 29 '17 at 11:55
  • In Pods > Target Support Files > Pods-[Target Name] – tentmaking Jun 29 '17 at 14:35
  • thanks, added but still getting [the following issue](https://drive.google.com/file/d/0B0BpWRnIuAXPeWtpMHNNSVlrQVU/view?usp=sharing) . What anything else do you suggest? (P.S. - [here's the content of the script](https://gist.github.com/alexszilagyi/e0db78298d0719b4f75fffe78eef661e) & [here](https://gist.github.com/alexszilagyi/e0db78298d0719b4f75fffe78eef661e#file-pods-target-resources-sh-L7) it crashes) – el.severo Jun 29 '17 at 14:54
  • @tentmaking I am just now running into the same issue with TFS. Can you provide a little more info on how you fixed this please? – steventnorris Sep 07 '17 at 20:27
  • @steventnorris We added a file (.tpattributes) to each Pods-[Target] directory (found inside Pods > Target Support Files > Pods-[Target] which has the entry seen in my answer above. Not sure what other info you need. – tentmaking Sep 08 '17 at 17:22
1

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

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.

CantThinkOfAnything
  • 1,129
  • 1
  • 15
  • 40
  • Hi @CantThink! Could you provide an example on how you added this setting? – Gehlen Apr 29 '19 at 13:20
  • 1
    @Gehlen You can define these kind of settings in the xcode build settings section. See https://medium.com/@kavithakumarasamy89/xcode-build-settings-user-defined-settings-manage-multiple-environments-with-single-target-3e5c1a307999 – CantThinkOfAnything May 02 '19 at 12:11
  • Than you @CantThink, very elusive! – Gehlen May 02 '19 at 13:42
  • Hi @CantThinkOfAnyThing! Yes, I did! But in my case I was configuring CI on bamboo, and the problem was that I was trying to access $TMPDIR on Build Phases, so I have no access.. I just remove it and works! Thank you anyway ! – Gehlen May 03 '19 at 16:43
  • @Gehlen glad i could help :) – CantThinkOfAnything May 04 '19 at 12:17
0

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
Stephan Vierkant
  • 9,674
  • 8
  • 61
  • 97
Saneesh
  • 1,796
  • 16
  • 23
0

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

Murat Uygar
  • 529
  • 6
  • 10
0

Delete Pods folder and Podfile.lock from ios folder then try to re-run

erdikanik
  • 674
  • 9
  • 11
0

In my case try this delete pod.lockfile clean all builds

  1. pod deintegrate
  2. pod install
  3. flutter run
Rashid Latif
  • 2,809
  • 22
  • 26
0

In the build phase you have to add chmod +x in front of the commands. For example, in my case I added following command in my [CP] Copy Pod Resources phase,

chmod +x "${PODS_ROOT}/Target Support Files/Pods-MyApp/Pods-MyApp-resources.sh"

Sazzad Hissain Khan
  • 37,929
  • 33
  • 189
  • 256