Android Studio 3.0 Preview - Studio does not have write access

AndroidAndroid Studio-3.0

Android Problem Overview


I'm using Android Studio 3.0 Canary 1. I'm trying to update it to Android Studio 3.0 Canary 2 but it shows the following error:

> Studio does not have write access to /private/var/folders/mk/h5qpw_r11_7ggh9q52n9hhlr0000gn/T/AppTranslocation/1321881E-C41D-4AF7-B207-F31894226D50/d/Android Studio 3.0 Preview.app/Contents. Please run it by a privileged user to update.

I even tried running Android studio with sudo from the command line:

sudo /Applications/Android\ Studio 3.0 Preview.app/Contents/MacOS/studio

But it didn't work. Any help will be much appreciated.

Android Solutions


Solution 1 - Android

You are a victim of the new macOS Sierra security feature called Path Randomization. Read more in [the relevant thread][1]. The simple way to get rid of this read-only random path is to move the app binary to a different folder (e.g. /Applications) with Finder (not command line, not PathFinder, just built-in Finder). It will move the app out of the quarantine. Other ways are described in the previous link.

[1]: https://apple.stackexchange.com/questions/262570/oddly-randomized-mounted-paths-in-sierra-for-certain-apps "Oddly randomized mounted paths in Sierra for certain apps?"

Solution 2 - Android

It seems you can also run into this issue if you have Android Studio installed via JetBrains Toolbox. The solution then is to just quit Android Studio, and install the update via the ToolBox.

Solution 3 - Android

Another workaround:

Reference to the IntelliJ IDEA / MacOS Sierra issue: https://stackoverflow.com/questions/40251201/upgrading-intellij-idea-after-sierra-upgrade-does-not-have-write-access-to-pri

This worked for me, replaced IDEA path with my Android Studio Directory

sudo xattr -d com.apple.quarantine /Applications/Android\ Studio.app
sudo chmod -R 777 /Applications/Android\ Studio.app

Solution 4 - Android

The easiest solution ever: I moved the Android Studio 3.5 Canary file from the Downloads folder to Applications folder.

note: make sure Android Studio not running.

Solution 5 - Android

  1. Go to applications->Android Studio
  2. Right click and select "Show Package Content"
  3. Right click on Contents folder and select "Get info"
  4. Look for "Sharing & Permission" option.
  5. Give read & write permission to your user.
  6. From gear icon select "Allow for enclosed item"

Solution 6 - Android

Simply move to Application folder. From----> /private/var/folders/............./d/ TO ----->. /Application or write access folder....

Solution 7 - Android

I was using the wrong command, it should be as given below:

sudo /Applications/Android\ Studio\ 3.0\ Preview.app/Contents/MacOS/studio

Solution 8 - Android

The same error showed in my Android studio as well, when I tried to update. So I copied my existing Android Studio.app file from a private folder to the Application folder. This fixed my issue.

Solution 9 - Android

In my case on Mac, Android Studio wasn't opened from the Applications folder for some reason. Make sure you open the one that's there and not a copy that's saved elsewhere, otherwise it won't have the privileges.

Solution 10 - Android

Possible solution in case Android Studio application is in the download folder:

Ran into a similar issue on Big Sur:

  • I moved it to the application folder
  • reopened Android Studio
  • retried update

Solved in my case.

Solution 11 - Android

You should not run something as bloated as Android Studio under "Sudo" as that gives full root access to every bit of code in it, and leaves any files it creates as owned by root! Talk about malware heaven...

The OP on this post mentioned that the problem is in /var/folders/... not in /Applications. For some reason, when you run Android Studio 3.x, it somehow gets itself mounted on /var/folders, as you can see by opening a terminal window and giving the command "mount":

/Applications/Android Studio 3.0 Preview.app on /private/var/folders/58/d2drp3pn7q10p6rqhck1t89c0000gn/T/AppTranslocation/80A800C1-65DB-4933-9B88-5CF90BFC8B0D (nullfs, local, nodev, nosuid, read-only, nobrowse, mounted by ida)

This does not happen when you run Studio 2.3 or any other normal application, so I'm guessing it's some "new improved" feature of 3.x that is causing this trouble.

Problem remains unsolved.

Solution 12 - Android

Your app can be out of applications folder. Did you check it. First check then if it is not in app folder move to app folder and try again.

If it doesn't work you must try terminal commands that the other answers.

Solution 13 - Android

In Mac goes to android studio location:

  1. Right click on android icon and select reveal in Finder

  2. Than In Finder, select Android Studio File and right click and select -> Show package contents

  3. Then, Select contents folder and right click and select get info then Go to sharing and permissions and select read and write than exit

  4. Open Android Studio and check for updates, its done.

Solution 14 - Android

Using the terminal and going to Android Studio binary and executing from terminal, such as

cd /Applications/Android\ Studio.app/Contents/MacOS/
./studio

Solved the problem for me.

It appears that launching a binary directly from terminal does not launch App Translocation protection. More information here

Solution 15 - Android

I had similar issue on my mac after migrating OS. This worked for me: Go to /Applications/Android Studio ... /Contents right click contents directory -> get info ->sharing and permission ,click lock icon to unclock settings then give your account read & write permission. then while your account type (admin)is selected click settings icon below and chose apply to enclosed items . done

Solution 16 - Android

My problem: I was opening my Android Studio directly from the "virtual device", then when I needed to update it always the prompt with the message "android studio does not have write access ..." was shown.

After right click on Android Studio icon in dock > Options > Show in Finder always opened the virtual device with the option to swipe it to the Apps folder. I did it, replaced the version in the Apps folder and ran again the same steps: right click on Android Studio icon in dock > Options > Show in Finder .

Now Finder showed AS in Apps folder. After this, after a new version of AS, it's possible without showing "android studio does not have write access ..." error.

Solution 17 - Android

if your using Ubuntu android 3.0 and getting error while updating to latest version and if you installed android studio using android installation guide example official video then you have to run sudo chown -R $USER:$USER /usr/local/android-studio/ this commend in your terminal

Solution 18 - Android

In my case the Android Studio is installed with brew. When using upgrade from UI it shows me the error described above. To upgrade the version I use:

> brew upgrade android-studio

Then it works without issues.

Solution 19 - Android

This happened to me when I was running an Android Studio Preview build from within the downloads folder. I forgot to move it to the Applications folder — upon doing so, everything worked as expected!

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAbhiView Question on Stackoverflow
Solution 1 - AndroidMateusz ŚlażyńskiView Answer on Stackoverflow
Solution 2 - AndroidWilliam BrawnerView Answer on Stackoverflow
Solution 3 - AndroidVaughn ArmadaView Answer on Stackoverflow
Solution 4 - AndroidBennyView Answer on Stackoverflow
Solution 5 - AndroidPrakhar BangarView Answer on Stackoverflow
Solution 6 - AndroidMANIView Answer on Stackoverflow
Solution 7 - AndroidAbhiView Answer on Stackoverflow
Solution 8 - AndroidSudhiView Answer on Stackoverflow
Solution 9 - AndroidperesisUserView Answer on Stackoverflow
Solution 10 - AndroidMjaludiView Answer on Stackoverflow
Solution 11 - AndroididarwinView Answer on Stackoverflow
Solution 12 - AndroidAli CanView Answer on Stackoverflow
Solution 13 - Androidchetan muliyaView Answer on Stackoverflow
Solution 14 - AndroidLucasMWView Answer on Stackoverflow
Solution 15 - AndroidAbed47View Answer on Stackoverflow
Solution 16 - AndroidCarlos DanielView Answer on Stackoverflow
Solution 17 - AndroidgiveJobView Answer on Stackoverflow
Solution 18 - AndroidmasalaView Answer on Stackoverflow
Solution 19 - AndroidjacoballenwoodView Answer on Stackoverflow