Android emulator doesn't work on Apple M1 chip - android

I've tried to run android emulator on an Apple M1 chip MacBook but it doesn't work and AVD Manager shows an error with the message: Could not start AVD. It seems the root of this problem is that M1 chip doesn't support virtualization and AVD needs VT-x for x86 images. Most of the images are based on x86 and arm based images aren't provided for latest android versions. Is there any solution to bypass this issue? (Except using physical devices and old images)

create AVD with arm64 based image will help to resolve the issue.

UPDATE: Here is the link to the Android Emulator Apple Silicon Preview:
https://androidstudio.googleblog.com/2020/12/android-emulator-apple-silicon-preview.html
They are working on it, but it will take time. I found some preview on Twitter - Preview of Android simulator on M1 And some solutions will be available at the end of the year. Maby.
And good source for the following is here on Reddit: ARM-based Macs for Android Development?

I doubt there is a workaround as the AVD uses Intel based API's to run the emulator, and because Apple broke up with Intel it won't work. You might just have to use a physical device or wait for a update.
That being said, there is work being done to support ARM based hosts.

Good news !
Edit on 28th July 2021 🎉 🌈
Apple Silicon Support
There is an arm64 release version available for Android Studio Arctic Fox (2020.3.1)
You can download it here https://developer.android.com/studio/archive
NDK builds doesn't work Unknown host CPU architecture: arm64
Solved https://stackoverflow.com/a/69540773/1079990
End of beta ! Thank you

Related

Android Studio Emulator not working in windows 11

My laptop Setup:
Windows 11 Pro 21H2 22000.132
11th Gen Intel(R) Core(TM) i7-11370H # 3.30GHz 3.00 GHz
Android studio latest Atric Fox 2020.3.1 build
For me, everything was working perfectly with Windows 10 and then I updated my laptop to windows 11. And after that when I start my android studio and run build on Emulator after some time waiting windows throws an error as
and the full one is shown below image
My device windows features are
I didn't change anything in android studio settings and my laptop settings but still got issues with my emulator.
Help me to figure out the issue or resolve it. I searched a lot regarding this I didn't find any appropriate solution regarding this issue. But I found that issue mentioned [google issue tracker](https://issuetracker.google.com/202188690 android emulator does not work on windows 11 (if we use hyper v) plz fix it) but priority is a little low as per google
Thanks in advance
Yes windows 11 breaks android emulator on some Intel and AMD chips. The is currently no official fix for this yet however there is a fix from the open source community in the link below
https://issuetracker.google.com/issues/202188690#comment18

How to create an Android virtual device MacBook air with M1 chip? Your CPU does not support VT-x

I am unable to create a virtual device on Android studio on my MacBook air. For all the system images it says that your CPU does not support VT-x. What is the solution or a probable alternative t use a virtual android device on MacBook air with the new M1 chip
You can't create an emulator directly on Android Studio, not yet, although, you can use this repository that google created
https://github.com/google/android-emulator-m1-preview
Here you can find the installers for Mac:
https://github.com/google/android-emulator-m1-preview/releases
Just install as any other software and when you open the emulator Android Studio will, automatically, recognize it.
Currently, no official stable emulator supported for M1 macs. Things are still in the development phase. Information is provided in the previous answer. Until official support comes, I suggest you use a physical device for testing of the application.
Now you can create an emulator for M1 mac:
Android Studio Dolphin, build from September 29, 2022; includes arm64-v8a out of the box under the ARM images tab which works well with M1 mac.

Android Emulator stuck loading screen on M1 mac/ Apple Silicon

I had downloaded Android Studio on my M1 MacBook air but I can't run the emulator and it just gives me an error. I search Android Studio requirements for mac and it says that it requires mac os 10.10 or higher and a minimum of 2 GB disk space and 4GB of ram. Anyone have this issue and how do I solve it?
I try download the arm image android studio it is stuck on the loading screen for the emulator.
As for now (19/11/2020) any of the Virtualization tools do not work with the new Apple M1 macs. So things like docker, emulators etc. We might have to wait a bit until this is fully supported unfortunately.
Good news !
Edit on 28th July 2021 🎉 🌈
Apple Silicon Support
There is an arm64 release version available for Android Studio Arctic Fox (2020.3.1)
You can download it here https://developer.android.com/studio/archive
When NDK runs into Unknown host CPU architecture: arm64 you can solve it here
End of beta ! Thank you
Edit on March 2021
I can confirm, this preview of Emulator works properly
https://androidstudio.googleblog.com/2020/12/android-emulator-apple-silicon-preview.html
In the blog there is a link to a private repo (2021-Jan-04). They moved repo to google and there you find V3 https://github.com/google/android-emulator-m1-preview/releases
Since v3 even audio-out works (no audio-in)
Edit on 4th Feb 2021
Now audio in and out works properly https://github.com/741g/android-emulator-m1-preview/issues/10#issuecomment-773532762
Edit March 2021
You can simply use one of them and it's working out of the box
On August release notes you can see on the emulator for Arm host section an entry where they said the support for M1 is in progress.
Check the link below:
https://developer.android.com/studio/releases/emulator#emulator_for_arm64_hosts
As of today the android emulator is up and working on the Apple Silicon here's a working demo from a googler
source: https://twitter.com/GoogleLfy/status/1332474914398322689
And the known issues here: https://androidstudio.googleblog.com/2020/12/android-emulator-apple-silicon-preview.html
we can expect the stable release by the end of 2020
here's a conversation about the same https://www.reddit.com/user/lfy_google/
Android studio has still not released a modified version for M1 macs, the version you are running, was originally made for intel chips, and is running via rosetta2. And rosetta does not support virtualisation, so you cant run emulator, but you could do all else coding stuff with minor bugs, for testing your code you may use a physical android device and it works just fine...please let me know if further problem exists...
This is the working emulator done by Android developers https://github.com/google/android-emulator-m1-preview
it works like a charm
I heard that the emulator won't work due to arm architecture of the apple silicon. Using a phone for debugging might be the only option. I also heard that android studio were working on an update for the M1.
For other ARM devices, it should be involved as an Instruction Set problem, in that case you can go to the AVD Manager of your AS and when create new virtual device, make sure to download the system image with arm64-v8a ABI, which is shown as bellow.
For Mac M1 chip, these arm64 images can not solve the problem and for now the best way is to wait Google release the compatible images.
There is a rudenmentary beta of the emulator for Mac M1 here
github link
Android has released beta emulator for M1 chipset
Please check this think to beta release
https://androidstudio.googleblog.com/2020/12/android-emulator-apple-silicon-preview.html?m=1
Currently, Android Studio only supports the HAXM Intel version (which isn't compatible with ARM processors) of virtualization, to run the emulator. But maybe in the coming weeks they might release the compatible versions for apple silicon processors. Till then the only option is to use a physical device.
there is an Android Emulator Apple Silicon Preview in the next documentation
https://androidstudio.googleblog.com/2020/12/android-emulator-apple-silicon-preview.html
android studio have made a rough initial preview of the emulator running on Apple Silicon.More details are available in this link below
https://androidstudio.googleblog.com/2020/12/android-emulator-apple-silicon-preview.html
Also you can download DMG file from GitHub:
https://github.com/741g/android-emulator-m1-preview
On my M1 machine, the emulator would get stuck ( not open ) and the dock icon would say 'qemu-system-aarch64' and then that was it.
I managed to get the emulator to start by running it via the terminal and adding the gpu host flag
emulator -gpu host -avd Pixel_5_API_32
P.S. I couldn't find the right stack issue, so I'm leaving this here.
It's because the new M1 chips run on arm Architecture and not x86.
You have to download the arm compatible virtual devices those are available in the other images tab inorder to run those emulators.
Also try this:
Wipe data of the virtual device by right clicking it in AVD Manager, then rerun the project.
Check the Android Emulator box in SDK Manager -> SDK Tools
Download the android-emulator-m1-preview.dmg from
https://github.com/741g/android-emulator-m1-preview/releases

Visual studio emulator android setup block

I'm trying to install the visual studio emulator for android to see my app, but I'm running into the following error.
My laptop is also running on a 64-bit OS.
Also, Xamarin is up to date inside visual studio and I'm using visual studio 2015.
Is there a workaround for this as my windows 8.1 is not the enterprise edition.
Thank you
The error message is quite clear, you need a 64-bit version of Window 8/8.1 or 10 with the Pro or Enterprise edition and also Hyper-V support. There is no workaround to use the Visual Studio Emulator without those requirements.
However, you are not limited to the Visual Studio Emulator. You can always use the standard Android emulators.
I had this same issue. What I had to do was enable Hyper-V and also change the setting in my bios to enable Virtualization Technology. In my case I had to enable Intel Virtualization Technology, but I think it would be called something different if you are using an AMD processor. After I did those two things, I was able to install the Emulator for Android.

"CPU does not support SVM" shown in Android-Studio on Windows, but not on Linux

I recently set up Android Studio on my computer (Lenovo E535, AMD Processor) on both Windows 7 and Arch Linux.
I got the emulator to run quite fast in Arch Linux and on Linux, I don't get the warning "Your CPU does not support required features (VT-x or SVM)".
Windows still shows me the warning. Virtulization is definitely enabled in the BIOS and it is definitely possible on my machine. Does Windows block SVM or does it not find it? Is it my Android Studio installation?
Here's what I found out for the next person who comes across this error:
Android Studio emulator won't run on Windows with an AMD processor. The error message is kind of misleading, as it suggests the problem is with the CPU. But it is within the troubleshoot message: "Windows/OSX computer with an Intel processor".
Solutions could be installing Linux and running Android Studio on that (which might come with its own issues), using a physical device for testing or using the slow ARM images.
To add to #MelanieB.'s answer you can also alternatively download an external emulator and use that for testing.
For example this one: https://www.visualstudio.com/vs/msft-android-emulator/

Categories

Resources