11

I just installed Android Studio 4.2.2 and Android Studio Preview (Arctic Fox Beta 5) to my Apple M1 Macbook.

When creating an emulator (arm64) I immediately receive the error:

AVD Manager: The emulator process for AVD Pixel_4a_API_30 has terminated

I then went to the log file of Android Studio (Help > Show log in Finder) and I see that the error occurs when Android Studio attempts to run the following:

~/Library/Android/sdk/emulator/emulator -netdelay none -netspeed full -no-snapshot-load -avd Pixel_4a_API_30

which outputs:

emulator: Android emulator version 30.3.5.0 (build_id 7036990) (CL:N/A)
emulator: ERROR: can't find the emulator executable.

Tried every possible solution I found online so far...

plr108
  • 1,201
  • 11
  • 16
Scaraux
  • 3,841
  • 4
  • 40
  • 80

2 Answers2

17

I had the same issue and found a simple solution after reading the README from the m1 emulator GitHub page.

If I'm right, what is happening is that you're trying to boot an image built for a different architecture. When selecting the image, you need to switch to the "Other Images" tab and look for an image with arm64-* stated in the ABI column. Everything else should work after.

Solution Steps

  1. Open the AVD Manager and and click + Create Virtual Device
  2. Select a device you want and click Next
  3. Switch the tab to "Other Images" Android Studio Select Arm64 Virtual Device Image
  4. Finish the creation process and run your app.
  • Solutions in similar questions which suggest modifications to PATH variable did not resolve my issue. The above answer from Alexandr resolved my issue on a Mac mini with an Apple M1 processor. – mcfisty Jul 19 '21 at 06:19
  • I did the above. I stated that I am using Arctic Fox beta 5, and using such version Android Studio will offer you the arm64 version by default (no need to go to "other images" tab) – Scaraux Jul 19 '21 at 17:06
  • I see. I haven't tried with the Arctic Fox Beta, but the Android Studio 4.2.2 worked with his approach. – Alexandr Sarioglo Jul 19 '21 at 23:33
-1

The latest Android Studio for Apple Chip build fixed my issue.

Scaraux
  • 3,841
  • 4
  • 40
  • 80
  • Running your app with emulators on Mac M1 ships requires some special configurations (as per Alexandr Sarioglo 's answer): 1) Add a special emulator from ADV Manager > Add > Pick a model > Next > from Special Image go to Special Images tab and pick any arm64-* value from ABI column (Only emulators with arm64-* works properly on M1 ships) 2) Show Advanced Settings to increase the device storage (specially for API level 31 and above) to avoid 'not enough space' exception. – Osama Remlawi Jan 17 '22 at 08:30
  • At the time I wrote the issue, I was ALREADY on Artic Fox Beta 5, which means the arm64 wasn't in the special tab anymore but was applied by default. See my comment above. – Scaraux Jan 19 '22 at 19:50