• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by redredred · Sep 22, 2011 at 10:01 AM · android

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

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

6 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by tpogmore · Dec 14, 2011 at 11:41 PM

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.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
3

Answer by Googol · Mar 02, 2012 at 12:21 AM

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

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image voilin585 · Dec 23, 2013 at 09:20 AM 0
Share

and now?how to solve the problem?

avatar image coeing · Jan 16, 2014 at 03:26 PM 0
Share

Thanks very much, this helped. Unfortunately another SecurityException is raised afterwards.

The registry path for Unity 4.x by the way is: H$$anonymous$$EY_CURRENT_USER/Sofware/Unity Technologies/Unity Editor 4.x/AndroidSdkRoot_h2651068356

avatar image
0

Answer by Googol · Mar 02, 2012 at 12:21 AM

Hi,

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

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Paul-Sinnett · Feb 05, 2013 at 12:44 PM

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.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image flberger · Jun 17, 2013 at 11:28 AM 0
Share

If your post is not answering the question, please consider writing a comment ins$$anonymous$$d.

avatar image
1

Answer by bz · Dec 19, 2013 at 05:26 AM

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

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

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
  • 1
  • 2
  • ›

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

10 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Touch to move 3 Answers

GUI Button doesn't Work on Android 2 Answers

Android Button Screen 1 Answer

clip() in ES3 shader still doesn't work on certain Adreno GPUs 0 Answers

Frame Drop on Touching or Swiping Screen 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges