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

[quote=“Dreamwriter”, post:1, topic: 596127]
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.
[/quote]

@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)

[quote=“Dreamwriter”, post:3, topic: 596127]
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)
[/quote]

@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

[quote=“Dreamwriter”, post:5, topic: 596127]
What I was using before was 4.6.7p2. I’ll submit a bug report but I can’t include the project with it
[/quote]

@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

[quote=“Dreamwriter”, post:7, topic: 596127]
Case #725127
[/quote]

@Dreamwriter

Thanks, we will investigate this bug.

[quote=“Dreamwriter”, post:1, topic: 596127]
when I do a chmod +x on it, the build works.
[/quote]

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

[quote=“mikaelgustafsson”, post:9, topic: 596127]
I’m having the same problem. Can you explain how I do a chmod +x?
[/quote]

@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.

[quote=“Simon_says_1”, post:13, topic: 596127]
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.
[/quote]

@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 :)

@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