Apple M1 - Your CPU does not support VT-x
Asked Answered
S

4

5

I tried everything and I am running out of ideas to have an Android simulator working on my mac.


Android Studio Bumblebee | 2021.1.1 Patch 3
Build #AI-211.7628.21.2111.8309675, built on March 16, 2022
  • I downloaded "the R API Level 30 image"

  • I installed "The Zulu OpenJDK" with

brew tap homebrew/cask-versions
brew install --cask zulu11

Edit: Following @mmBs advice, I changed the path to Gradle

Preferences > Build > Gradle > Gradle JDK > azul-11

gradle JDK

...same result.

I can't make the virtual device works on my machine.

enter image description here

I always have this device manager error when I try to launch the simulator.

enter image description here

Question:

How can I have an android simulator working with an Apple M1?

Smith answered 2/5, 2022 at 13:27 Comment(0)
S
2

2024 Up to date solution

Android emulator is now compatible with arm processor out of the box.

But when you create a new emulator, not all emulator and system images in the list are arm compatible. Make sure you make the right choice (see screenshot above)

enter image description here

Smelt answered 25/10, 2023 at 16:27 Comment(0)
A
3

What works for me:

  1. Install Android Studio from the official webpage for M1 processors and then install Android SDK in default location ~/Library/Android/sdk.
  2. Install java using brew - brew install openjdk@11 (android supports java 11, no needs for installing java 17 etc.) and then add it to the path.
  3. Set your android paths in zsh or bash:
# Path to Android SDK
export ANDROID_HOME=/Users/$USER/Library/Android/sdk
export PATH="$ANDROID_HOME/platform-tools:$ANDROID_HOME/emulator:$ANDROID_HOME/tools:$ANDROID_HOME/ndk-bundle:$PATH"
  1. Install the emulator image for arm --> arm64-v8a (from Android Studio's Device Manager).
  2. Done - it should be working. I use M1 processor and the emulator works just fine. You don't need any m1-emulator-preview from github.

Edit: you can check this thread as well: Android Studio/Emulator on macOS with ARM CPU M1

Awlwort answered 2/5, 2022 at 13:43 Comment(7)
Same error I created a new project and I don't know if it's related to this error ``` An exception occurred applying plugin request [id: 'com.android.application'] > Failed to apply plugin 'com.android.internal.application'. > Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8. You can try some of the following options: - changing the IDE settings. - changing the JAVA_HOME environment variable. - changing org.gradle.java.home in gradle.properties. ```Smith
Yeap, so you have an answer --> Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8. You need to check your path for you project. 1. click 'cmd + ;' to open the a project structure. 2. Go to sdk location --> Gradle settings. 3. Choose gradle jdk (you can choose bundled jdk 11 from android studio). 4. click ok and it should be set.Awlwort
making progress here 09:41 Gradle build finished in 638 ms but my main problem remains Android studio refuses to boot the virtual device —thanks for the input question editedSmith
ok, what emulator version did you install? Also, did you install HAXM? If yes, you should uninstall it.Awlwort
Btw have you checked this thread? #64907654Awlwort
Yes that was my starting point before posting here —I tried all Android ARM Images arm64-v8a from 10 to 12Smith
Intel_HAXM was already removed, doubled checked with github.com/intel/haxm/wiki/… thank you for your support —I will give up on thisSmith
S
2

2024 Up to date solution

Android emulator is now compatible with arm processor out of the box.

But when you create a new emulator, not all emulator and system images in the list are arm compatible. Make sure you make the right choice (see screenshot above)

enter image description here

Smelt answered 25/10, 2023 at 16:27 Comment(0)
S
1

this worked for me!!! Preferences->Appearance&Behavior->Android SDK->SDK Tools Check these..see pics enter image description here

Siena answered 8/1, 2023 at 15:37 Comment(1)
For some reason I do not see this Emulator Accelerator option, I'm on MacOS 14, M2 Pro chip, Android Studio electric eelThrippence
G
1

I had the same problem after switching from an intel Macbook to an M3 Macbook...

Removing all the SDK's (which have been copied with the iOS transfer tool from the old mac to the new one) helped: I cleared the .android folder and Library/Android folder under my user folder and reinstalled the Android Studio.

Gallia answered 23/9 at 20:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.