Build in Unity shows error Native error= Access denied

Viewed 4186

When trying to build in unity, error as per below:

Error building Player: Win32Exception: ApplicationName='/Applications/Unity/Hub/Editor/2019.3.0a6/PlaybackEngines/AndroidPlayer/SDK/tools/bin/sdkmanager', CommandLine='--list', CurrentDirectory='/Users/meeples/Unity projects/myGame', Native error= Access denied

2 Answers

From the path structure, the question poster was in a macOS environment; this then also applies to linux in many cases. The unity android SDK was installed but they did not have filesystem permission to access it. The Unity community has provided several solutions to this issue that I have repeated here.

The least destructive method for resolving the issue is to either make the problem file(s) or the entire Unity installation runnable without elevated privileges through:

chmod  +x  /Path/To/Problem/File  /Other/Problem/File  /Etcetera

or

chmod  -R  +x  /Path/To/Unity

The problem file path can be discovered from the value of ApplicationName in the error message, as can the Unity installation path in most cases.

It may be necessary to sudo chmod depending on the system environment.

It is also possible to:

- take ownership of the problem file(s) with chown.

- clone the problem file(s), delete the original(s), and replace them.

Both of these methods effectively take ownership of the file(s) and allow the user to execute them, resolving the immediate issue, but can introduce new problems like access failures for other users on the same system.

2019.3.0a6 is an alpha version!

As any other alpha version it should be used only for testing new features. It is not untypical that an alpha version is full and full of bugs and errors ... that's basically the whole idea behind an alpha version.

Your specific one might be related to this known issue

Android: Project build fails with java.io.IOException (1161216)

or a "new" one so if you are not sure you would be better reporting it back to Unity ;)


If you want to use it for production stay with the latest stable version which is 2019.4 LTS.

Related