Preferences->Android SDK Location error

Now I am going but I get an error that I want to do with the development of Android Unity3D.

The error is

SecurityException: A security error has been detected.
Microsoft.Win32.Win32RegistryApi.GenerateException (Int32 errorCode)
Microsoft.Win32.Win32RegistryApi.OpenSubKey (Microsoft.Win32.RegistryKey rkey, System.String keyName, Boolean writable)
Microsoft.Win32.RegistryKey.OpenSubKey (System.String name, Boolean writable)
(wrapper remoting-invoke-with-check) Microsoft.Win32.RegistryKey: OpenSubKey (string, bool)
Microsoft.Win32.Registry.ToKey (System.String keyName, Boolean setting)
Microsoft.Win32.Registry.GetValue (System.String keyName, System.String valueName, System.Object defaultValue)
UnityEditor.AndroidSdkRoot.GuessPerPlatform () (at C: / BuildAgent/work/842f9557127e852/Editor/Mono/Utils/AndroidSdkRoot.cs: 13)

This error preferences-> occurs when you click on the column designated Android SDK Location.

Determined because no path for this error can not be built.

I’m sorry, please do. Us

I’ve had the same problem. I don’t think this is due to an admin installation of ADK, because the error arises before the ADK path has been selected.

The problem is that for some unknown reason (for me), Unity tries to open HKLM\Software registry key for read/write, and that cannot be done by a non-privileged user. If you are running Unity with a normal user, you won’t be able to set the android SDK path, no matter who installed it.

But… you CAN hack the path into the registry yourself. Using regedit, search for HKEY_CURRENT_USER\Sofware\Unity Technologies\Unity Editor 3.x\AndroidSdkRoot_something and put the real ADT path, using / instead of \ even in Windows. Even more surprisingly, you can just write an invalid path, for example c:/. After that… you’ll be able to use the Unity preferences window without problems to select the valid path… ???

Hope this helps; I’ve lost two days on that…

This problem is caused by installing the Android SDK under an account with higher permissions than your current account, i.e. installing the SDK as superuser and then running Unity as a regular user.

Please try Run Unity as an Administrator.
I could do it.

http://www.labnol.org/software/run-as-administrator/

Hi,

I’ve had exactly the same problem in some computers, but not in others. In my case, the problem was not caused by

I had this problem and editing the reg key allowed me to set the folder as described above. However, it then fails with another security exception after that. This one gives no additional details. It also deletes the reg key.

We’re completely stuck on this. It works fine only if Unity is run using the Administrator’s account. Our student users are unable to use Unity for Android on any of our machines at the University.

I’ve had exactly the same problem in win7 os. The problem has made me lost three days,oh… how to solve it?