Xcode Build build error: sh: bad interpreter: Permission denied

663 views Asked by At

I've been trying to compile a Cordova project in Xcode with no success for the last 2 days. First of all, this is a clone of another project, with just a few changes, that compiles with no issues. And my experience in Mac is only using Xcode to compile Cordova projects for iOs.

The error I get is the following:

Xcode Error

The step it's talking about is this:

Build Phases

I've had this same error other times, but by giving execute privileges to the sh file with chmod +x as explained in Cordova Xcode build failed "Permission denied", it worked, but won't this time.

*What the script does is basically copying the www folder from Cordova to the ios project. And is exactly the same script in other projects that compile with no issues.

So, searched for the error, and gave total permisions with chmod 777 (first I went with +x as I've done other times as mentioned, but didn't work so I went for total control just in case) to both sh scripts, the one mentioned in the error, and the one mentioned in the step. And finally to the entire project folder with chmod -R .. just in case.

I also gave full access control to the disk to Xcode on the security & privacy settings (Wouldn't understand it would be necessary cause as mentioned, it compiles other projects, but again, just in case):

Security % Privacy

Also moved it to the Desktop from the Documents folder it was (Although the other project is in the same folder in Documents, and as said, it compiles), but didn't work there either.

I'm able to execute both scripts in the Terminal, but since one relies on Xcode variables won't work, but it let's me run it.

I've checked if I see any difference between this project and the other one (That lets me build it), but I see no differences that I can see, apart fromn the change in the code.

If it helps, I'm running Catalina 10.15.6 Any help?

1

There are 1 answers

0
Jorge Lizaso On

Problem was there's a space between /bin and /sh in the shell command of the Script. "/bin/sh". /facepalm