Android Studio very laggy on M1 Apple Silicon chip
Asked Answered
R

7

27

I've upgraded to the M1 chip 2020 Macbook Air from a 7th gen. Intel chip pc. Overall, I'm very happy and content with it but when it comes to Android Studio performance, which I use quite often, it is very disappointing I'm sorry to say. When will an Apple Silicon compatible version be available? Are any of you guys have any clue?

Refrangible answered 21/3, 2021 at 10:6 Comment(1)
Does this answer your question? Apart from emulator, is android studio working fine in M1 macsCosmos
F
28

Starting from Android Studio Artic Fox version, they not only changed versioning number style (replaced number system with Year-styling Version names), but also introduced Android Studio for M1/Apple Silicon (arm arch 64bits).

To check if you'r using right Android Studio for your M1, click on 'About Android Studio' and check the runtime, it should show as aarch64 (ie. Arm architecture 64bits). If not, mostly you might be having x86_64 if you installed regular Mac's Android Studio. About Android Studio with [64 bits] arm runtime for M1

To switch to M1's Android Studio,

  1. first exit already installed Android Studio, if it's open.
  2. Go to Finder and under 'Applications', rename 'Android Studio' to preferably 'Android Studio_x86_64'.
  3. Go to Android Studio downloads page (https://developer.android.com/studio#downloads), and download the one tagged as 'Mac (64-bit, ARM)' and unzip and move to 'Applications'.
  4. Click to open 'Android Studio' from the Finder/Applications. You may drag and add it as a Dock shortcut option.

Good thing is that there is no extra installation required and the existing project, (at least for me), opened without any issues. Android-SDK based and Flutter projects should be good right after switch, NDK not yet there.

AS is now faster again as you are using it as intended on Apple M1's chipset. !

Feast answered 9/10, 2021 at 23:14 Comment(1)
Thank you so much. I was using x86_64. I have updated to 64 but arm and changed the VM options. It is working smoothly.Tonry
V
51

I had the exact problem and the solution was as follows: Open Android Studio, go to Help -> Edit Custom VM Options and add the following lines:

-Dsun.java2d.opengl=true
-Dsun.java2d.opengl.fbobject=false

Restart the IDE and wait for the files to sync. Done, IDE running smooth again.

Vitovitoria answered 29/9, 2021 at 1:9 Comment(10)
Saved my day! It's very fast now.Pellikka
The only thing that works for me. Thanks!Marthamarthe
This does work on M1 Pro as well. Thanks! But can anyone explain what is the meaning of these 2 lines?Amphidiploid
Finally! I was going crazy with this lag. Can't code at regular speed with everything lagging randomly. Finally this fixed it. Thank you!Egypt
Can someone explain this please, it works like charm but what's going on?Fallible
@Emad Aldeen, Maybe he's the one who was responsible for this issue and he's now providing us the solution. Just kidding! thanks man. you saved everything. you're awesome!Surfing
It saved my day, but what's happening under the hoodBee
Hi, bro unfortunately android studio doesn't work at all after I add these two lines any idea! :(Utility
For everyone who are curious about what those flags are, opengl: To enable the OpenGL-based pipeline, which provides hardware acceleration. [1] opengl.fbobject: Setting this property will cause Java 2D to fall back on the older pbuffer-based codepath. [2] [1] docs.oracle.com/javase/7/docs/technotes/guides/2d/flags.html [2] docs.oracle.com/javase/10/troubleshoot/…Salisbury
After a month of hardcore in my super laggy Android Studio (cant even load recommenndation when typing), you save me. It works like a charm, tysmWherewithal
F
28

Starting from Android Studio Artic Fox version, they not only changed versioning number style (replaced number system with Year-styling Version names), but also introduced Android Studio for M1/Apple Silicon (arm arch 64bits).

To check if you'r using right Android Studio for your M1, click on 'About Android Studio' and check the runtime, it should show as aarch64 (ie. Arm architecture 64bits). If not, mostly you might be having x86_64 if you installed regular Mac's Android Studio. About Android Studio with [64 bits] arm runtime for M1

To switch to M1's Android Studio,

  1. first exit already installed Android Studio, if it's open.
  2. Go to Finder and under 'Applications', rename 'Android Studio' to preferably 'Android Studio_x86_64'.
  3. Go to Android Studio downloads page (https://developer.android.com/studio#downloads), and download the one tagged as 'Mac (64-bit, ARM)' and unzip and move to 'Applications'.
  4. Click to open 'Android Studio' from the Finder/Applications. You may drag and add it as a Dock shortcut option.

Good thing is that there is no extra installation required and the existing project, (at least for me), opened without any issues. Android-SDK based and Flutter projects should be good right after switch, NDK not yet there.

AS is now faster again as you are using it as intended on Apple M1's chipset. !

Feast answered 9/10, 2021 at 23:14 Comment(1)
Thank you so much. I was using x86_64. I have updated to 64 but arm and changed the VM options. It is working smoothly.Tonry
P
11

Now Android Studio Bumblebee (2021.1.1) is available in Stable Channel. If your version is older than Bumblebee, download it for more performance.

I find out that the link shown by default is for intel architectures.

Automatic update performed by android studio also downloads the intel version even if this download occurs on a Mac with an ARM architecture (M1) .

You should navigate to the download options and choose ARM architecture manually.

You can download version 2021.1.1.22 Bumblebee for MAC ARM (M1) here (Link updated on Mar 7 2022 )

Perianth answered 29/7, 2021 at 7:40 Comment(10)
Artic Fox is a bit laggy as well in stable channel for my m1 MacBook airWalrath
@vanditvasa I have found that the link shown by default is for intel architectures. You should navigate to the download options and manually choose the arm architecturePerianth
@YagoReyViñas Bro how should I navigate Manually. Can you please Guide ? It will be very helpful if you edit your answer that how can we change it manually. ThanksViki
Hi @irfan. I add download link extracted from Android studio web. You can view download link in this page developer.android.com/…Perianth
yes, arm version is really faster in m1 macbook proBrewster
after downloading the arm one it is running on another level. since i just updated to artic fox the arm version was not downloaded. thanks @YagoReyViñas.Kristalkristan
This should be the accepted answer.Shithead
hmm..not sure I would trust using a link that is not pointing directly to android.com. The official link for downloads is here: developer.android.com/studio#downloadsTranssonic
@Transsonic The link that I show in the post is the one provided by Google to download Android Studio. You can check it on the download website that you mention. Corresponds to the download link of the Mac platform (64-bit, ARM), and I try to update the link as Google does so that the post is not outdatedPerianth
Working perfectly and very smooth in M1, 2020.Causality
A
9

Check Android Studio Arctic Fox (2020.3.1) Beta 3 (have apple silicon support) https://developer.android.com/studio/archive

enter image description here

Abeyta answered 15/6, 2021 at 13:11 Comment(1)
Still very slow.Pellikka
A
3

use Intellij CE the latest version released on April 6th has native support for m1 and its very fast and intuitive, i've been using it and it's not very different from android studio

Edit: September 21

Download m1 native supported Android studio through https://developer.android.com/studio/archive Download Mac (Apple silicon)

Ajay answered 11/4, 2021 at 8:34 Comment(8)
I think that this cant be called very fast, Im using M1 with Intellij Ultimate developing on android and I have lagVeronicaveronika
Well, it doesn't lag using CE. I've been using it for nearly a month and i have no problem with itAjay
No, it's not very fast. It's as terrible as everProboscidean
CE works good on Mac M1 . just uninstall Android Studio .Crook
In my case I had to click the "Download options" button to select android-studio-2020.3.1.22-mac_arm.zip. Back then I clicked just the green button "Download Arctic Fox" and I got the x86 version which worked terrible but the arm version works instantly.Wheezy
This should not be the accepted answer. Its possible to do it right in Android Studio in few stepsPerianth
@yago trust me back in April there were no other options but intellijAjay
I am using the build 2020.3.1 Patch 3 build ARM64 and it is still dog slow. I am moving to Visual Code Studio.Pellikka
C
0

All the above did not work and my emulator was completely unusable but in my case the following fixed my issues:

  • Android studio Preferences > Tools > Emulator
  • Make sure 'Launch in a tool window' is checked
  • 'Wipe Data' on emulator and then relaunch

Having the emulator launch as a separate window caused a huge slowdown but this fixed it immediately

Chromoplast answered 19/4, 2022 at 11:16 Comment(0)
D
0

Using Flamingo Patch 2, sometimes the performance is attrocious.

Ie, it was taking seconds for a selection to be selected, seconds to respond to key presses, etc.

I had tried the opengl fixes above, but they weren't really resolving the issue.

I used the "Repair IDE" command in the File menu the other day for an unrelated reason, and Step 3 resolves the issue. At least temporarily.

The other issue appears to be that whenever the emulator fires up it slows to a crawl again... disabling launch in tool window solves that as it loads in an external app/process instead

Damato answered 14/7, 2023 at 5:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.