MapFileParser.sh: Permission denied - not set as executable in Unity 4.6.8p1

I just installed Unity 4.6.8p1 on PC, made a build, copied the build folder to my Mac, and when I build it I get

Shell Script Invocation Error…MapFileParser.sh: Permission denied

It seems the file isn’t being set as executable, when I do a chmod +x on it, the build works.

2 Likes

@Dreamwriter

I’m not sure that there is much we can do to correct this. When the file is copied from Windows to OSX, is there a way to specify the executable permission on it? I’m not sure that there is.

Not sure, but this problem didn’t happen in the previous Unity version that I had (that’s how we make most of our builds here, build on PC, copy to Mac, build and push in Xcode)

@Dreamwriter

Which version of Unity did you have previously where this worked? I wonder if it did not have the MapFileParser step. If so, we then we would like to take a closer look at this. Can you submit a bug report? Please include the process you use to set up the build environment.

What I was using before was 4.6.7p2. I’ll submit a bug report but I can’t include the project with it

@Dreamwriter

I believe that 4.6.7p2 had the MapFileParser step, so thanks for submitting the bug report. I don’t think that a project is necessary for this bug.

Case #725127

@Dreamwriter

Thanks, we will investigate this bug.

I’m having the same problem. Can you explain how I do a chmod +x?

@mikaelgustafsson

You can run the command man chmod for more details about chmod, but you should be able to run this command on the OSX machine:

chmod +x /path/to/MapFileParser

This will set the exectuable permission on the MapFileParser utility, and allow it to be run.

11 Likes

I’m having a similar problem, going to try the chmod command and see if it works. I also compiled on windows and sent to my mac

the chmod +x command worked for me!

2 Likes

This issue still exists in 5.3.5p7, I always have to manually set this permission in the terminal later if building xcode project on PC and moving files to Mac.

@Simon_says_1

I don’t think that this is an issue we can easily correct, unfortunately. Since Unity is not doing to copy from the PC to the Mac, we don’t control how the permissions are set (or not, in this case).

When I zip the files on PC, then copy to Mac, the unzip it, it seems to preserve all the permissions. This workaround works best for me and resolves the “Permission denied” error in XCode.

2 Likes

@erik_fonseka

You really helped me! Thanks!!

Set attributer read-write for all users and groups and all will be fixed :slight_smile:

@PlayJoWee how do you do that? Can you give the steps. I am still learning the Apple ecosystem.

Sorry to necropost but this just occurred for me with 2017.3.0f3, and this was a top result in google.

The error appeared when i started pushing files FROM the windows machine onto a shared drive/folder on the mac .

I tried changing the file permissions on the files directly on the mac, and it still threw the error despite ‘everyone’ having read/write access.

The solution was to instead, go onto the mac, and pull the files off a windows network drive. Apparently when doing it this way the mac is able to set the file permissions properly.

If you hate the command line or can’t use it for whatever reason you can usually have scripts run without -x (execute) permission by adding 'bash ’ in front of the script under Build Phases>Run Script in XCode
i.e. bash “$PROJECT_DIR/MapFileParser.sh” should work