Android Studio does not have write access

Viewed 12518

I am using android studio 3.4.2. When I try to update the android studio it says

"Studio does not have write access to /app/extra. Please Run it by a privileged user to update"

How to solve it?

enter image description here

7 Answers

I would suggest to set your current user as owner of /usr/bin/android-studio

This will resolve the issue in long term:

sudo chown -R $USER:$USER /usr/bin/android-studio

Navigate to your Android studio folder via terminal then run android studio with administrator privileges, using sudo or su. If you provide more information, like which OS you are using, maybe I'll be able to tell you the exactly command line you should use.

Edit:

  1. Open terminal application, then type de following : cd ~/android-studio/bin *

  2. Now we must run Android Studio script file studio.sh as administrator:

sudo ./studio.sh

If doesn't work try : sudo sh studio.sh

  1. (Optional) To prevent this problem every time you want update android studio, see https://stackoverflow.com/a/37704528/8513494

And is it.

  • I'm assuming that your android studio is located on your user folder, if there's a problem with this step, you should check /opt/ directory and look out for android studio installation folder or see https://superuser.com/a/1080329

I would suggest setting up your current user as the owner of Android Studio

Linux

sudo chown -R $USER:$USER /usr/bin/android-studio

Mac

sudo chown -R $USER /Applications/Android\ Studio.app

or if you using android studio portable then you can use custom path like this.

sudo chown -R $USER: pathDirOfYourAndroidStudio/Android\ Studio\ Preview.app

For linux mint 20:

sudo chown -R $USER:$USER /opt/android-studio-4.2/android-studio/

Happens on Mac when you do not have Android studio in /Application directory. Move it there, if it is not resolved, try this answer.

enter image description here

Set access to Read and Write (default is Read only)

I'd suggest changing the owner of the android-studio directory, doing so depends on the path of your android studio. Here is mine

sudo chown -R $USER:$USER /opt/android-studio

But you might have the following path

sudo chown -R $USER:$USER /usr/bin/android-studio

Check well and enjoy

Related