37

When I check for updates in Android Studio (1.0.1) it says there is an updates available (1.0.2), but shows this error:

Android Studio does not have write access to /Applications/Android Studio.app/Contents. Please run it by a privileged user to update.

When I try and open it as root, I get an error saying files are missing and it can't start up.

How am I supposed to update with these errors? Should I have installed it as a non-privileged user to start with?

EDIT: I STOPPED GETTING THIS ERROR SEVERAL VERSIONS AGO.

Farwa
  • 6,156
  • 8
  • 31
  • 46
aaa90210
  • 11,295
  • 13
  • 51
  • 88

10 Answers10

96

Open terminal and type: sudo chmod -R 777 /Applications/Android\ Studio.app/Contents/

Balder
  • 8,623
  • 4
  • 39
  • 61
thanhnd
  • 1,451
  • 1
  • 11
  • 16
39

As a few people have said, it's probably not best practice to give everyone permissions (using 777) to read, write and execute. However, if you (like me) have multiple accounts on your personal computer it's perfectly okay to give everyone in the same group (using 775) permissions to read, write and execute.

sudo chmod -R 775 /Applications/Android\ Studio.app/

The error comes because a different user account installed Android Studio than is currently trying to update it. For example, I have a personal and work account on my BYOD computer, my personal account installed Android Stuido, but my work account wanted to update it. By default only the owner can write to the app folder. I needed both accounts to have write permissions, both accounts were in the admin group, so I gave write permissions to the whole group.

92tonywills
  • 849
  • 9
  • 13
27

I would not change the permission set, but run the app as a super user and it worked.

sudo /Applications/Android\ Studio.app/Contents/MacOS/studio 
gvatreya
  • 444
  • 1
  • 6
  • 12
19

I went though this issue after proceeding update on my Mac.

I think giving 777/775 is not the proper way .. security speaking !

Try to check your account by which you have logged in and the account Android Studio installed with.

Check current owner of Android studio

stat /Applications/Android\ Studio.app/

And check current user id and group you are using

Get current userID by:

id -u -n

Get current group by:

id -g

That will give you a clear idea where is the issue ... may be userId is different or group or both.

Then you have two options:

  1. switch to other account by which Android Studio installed with ( the one you see as output from 'stat' command ) by

    sudo su [userID]
    

    Next step to run Android Studio from command:

    open /Applications/Android\ Studio.app/
    
  2. Reset ownership of Android Studio to current account ( from id -u -n & id -g ) by

    sudo chown -R [userID]:[group] /Applications/Android\ Studio.app/
    

Thats it ..

Maher Abuthraa
  • 17,493
  • 11
  • 81
  • 103
  • 1
    This one should be a preferred /decent answer. I just put a little personal preference as follow. 1. id -u -n 2. id -g -n 3. sudo chown -R {user}:{group} {your android studio folder} – yas Mar 21 '17 at 11:34
  • 2
    Actually I just did `sudo chown -R $(whoami) /Applications/Android\ Studio.app/` and it worked. Upvoted your ans! :-) – vishwarajanand May 01 '20 at 11:32
5

Check if your Android Studio is not running on a virtual drive, look on your desktop if there is a drive with Android studio, if you can see the drive, right click on it and press eject, then go to applications look for Android studio and run it from there and this should allow you to update.

n4zg
  • 387
  • 2
  • 6
  • 20
3

Got the same problem. I wouldn't recommend giving full permissions to everyone on this folder.

In my case the issue was caused because the owner of the folder wasn't the current user. You can check the user/group owner of the folder this way: ls -l /Applications/Android\ Studio.app/

To change the user of the folder you can use chown.

Sori Alex
  • 61
  • 2
  • I've installed IDEA with sudo. So installation path belongs to root. Changing owner of the folder worked for me sudo chown yourUser:yourGroup -R /pathToYourIdea – Vadim Feb 23 '16 at 08:38
  • I had to change my computer username from "ab2" to "ab". But when I look at the ls -l of my installation it shows the owner as "admin". Neither "ab" nor "ab2", so I don't know which user to chown to. – HelpMatters Apr 26 '16 at 09:16
2

Nothing worked for me , so just move the app to Application folder

Code_Life
  • 5,742
  • 4
  • 29
  • 49
1

try with sudo /Applications/Android\ Studio.app/Contents/MacOS/studio

Siva Karuppiah
  • 995
  • 1
  • 8
  • 17
0

The problem happened for me because the android studio not in Applications folder. you need to add android studio to applications folder and it will work.

I followed this solution: https://www.youtube.com/watch?v=15OLD22wDzE

MohamedHarmoush
  • 1,033
  • 11
  • 17
-1

On your mac go to applications right click on Android studio in the permissions section give everyone read-write access and restart android studio