Android Studio 3.0 Preview - Studio does not have write access

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.


Solution 1:

You are a victim of the new macOS Sierra security feature called Path Randomization. Read more in the relevant thread. 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.

Solution 2:

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:

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.