18

I receive the error in object. I tried to do all the checks (all upgraded and proper installed) but I continue to have the error:

AVD Manager:

The emulator process for AVD was killed.

AVD Manager: The emulator process for AVD was killed.

Here are the details of the emulator:

Name: Pixel_3a_API_30
CPU/ABI: Google Play Intel Atom (x86)
Path: /Users/simone/.android/avd/Pixel_3a_API_30.avd
Target: google_apis_playstore [Google Play] (API level 30)
Skin: pixel_3a
SD Card: 512M
fastboot.chosenSnapshotFile: 
runtime.network.speed: full
hw.accelerometer: yes
hw.device.name: pixel_3a
hw.lcd.width: 1080
hw.initialOrientation: Portrait
image.androidVersion.api: 30
tag.id: google_apis_playstore
hw.mainKeys: no
hw.camera.front: emulated
avd.ini.displayname: Pixel 3a API 30
hw.gpu.mode: software
hw.ramSize: 1536
PlayStore.enabled: true
fastboot.forceColdBoot: no
hw.cpu.ncore: 4
hw.keyboard: yes
hw.sensors.proximity: yes
hw.dPad: no
hw.lcd.height: 2220
vm.heapSize: 256
skin.dynamic: yes
hw.device.manufacturer: Google
hw.gps: yes
hw.audioInput: yes
image.sysdir.1: system-images/android-30/google_apis_playstore/x86/
showDeviceFrame: yes
hw.camera.back: virtualscene
AvdId: Pixel_3a_API_30
hw.lcd.density: 440
hw.arc: false
hw.device.hash2: MD5:0e6953ebf01bdc6b33a2f54746629c50
fastboot.forceChosenSnapshotBoot: no
fastboot.forceFastBoot: yes
hw.trackBall: no
hw.battery: yes
hw.sdCard: yes
tag.display: Google Play
runtime.network.latency: none
disk.dataPartition.size: 2G
hw.sensors.orientation: yes
avd.ini.encoding: UTF-8
hw.gpu.enabled: yes
nik7
  • 806
  • 3
  • 12
  • 20
Simone
  • 209
  • 1
  • 2
  • 6
  • Here I have more detals on the log: Application Specific Information: *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArray0 objectAtIndex:]: index 0 beyond bounds for empty NSArray' abort() called terminating with uncaught exception of type NSException – Simone Jan 05 '21 at 10:11
  • I think you have setting problem try re installing your adb , and also check if you SDK location is set correctly in the project structure and weather you have installed the latest dependencies – Charles Jan 05 '21 at 12:35

9 Answers9

14

When emulating on a M1 Mac you need to select a system image from the "Other Images" Tab. Make sure you take a arm64 image.

There is also a preview-repo from google regarding M1-emulation.

enter image description here

Neur0
  • 367
  • 5
  • 13
12

Fix: Follow the guide here Codesign QEMU. Use /Users/<username>/Library/Android/sdk/emulator/qemu/darwin-x86_64/qemu-system-x86_64 as the directory for qemu (might be different).

The issue I had was with qemu-system-x86_64. Running the emulator in terminal would show this error: cannot add library /Users/<username>/Library/Android/sdk/emulator/qemu/darwin-x86_64/lib64/vulkan/libvulkan.dylib: failed.

To fix it I found these posts: Reddit Codesign QEMU

Dhananjay Suresh
  • 1,030
  • 1
  • 14
  • 28
7

UPDATED - 28/4/2021

  1. create entitlements.xml file with the following content:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
        <key>com.apple.security.hypervisor</key>
        <true/>
    </dict>
    </plist>

  1. and run on qemu path as necessary where your SDK is located.
codesign -s - --entitlements entitlements.xml --force ~/Library/Android/sdk/emulator/qemu/darwin-x86_64/qemu-system-x86_64

Answer based on https://www.arthurkoziel.com/qemu-on-macos-big-sur/

Related issues:

https://issuetracker.google.com/issues/181142249 https://issuetracker.google.com/issues/186436367

Update to Android Emulator 3.5.6 should fix it now

Original solution >>> Thanks to laalto

DouggyC
  • 83
  • 1
  • 6
3

Change "hw.gpu.mode: auto" to "hw.gpu.mode = software".

  • 4
    It worked for a while, after the new update of Intel x86 Emulator Accellerator (HAXM installer) v7.6.5, I have the same issue :-( – Simone Mar 21 '21 at 17:21
  • Same here… not working anymore, with HAXM 7.6.5, updated within Android Studio – rgomesbr Apr 27 '21 at 01:30
  • Same after HAXM 7.6.5 – Tiago Machado Apr 27 '21 at 09:55
  • Same, HAXM 7.6.5 seems to be not working. Is it possible to downgrade? – Dhananjay Suresh Apr 27 '21 at 14:38
  • @DhananjaySuresh I tried manually installing 7.6.1 from the GitHub repo… couldn't get it to work either… I even uninstalled Android Studio and all of its dependencies, then reinstalled it all… nothing seems to work here :-/ — at least not in my limited knowledge towards Android development and related. – rgomesbr Apr 27 '21 at 15:21
  • 1
    @rgomesbr See my answer, not sure if it will be the fix you need but it worked for me. – Dhananjay Suresh Apr 27 '21 at 15:34
1

I have faced this issue before, just follow step below;

  1. Go to SDK Manager -> SDK Tools
  2. Update 2 option below:
    • Android emulator
    • Intel x86 Emulator Accelerator (HAXM Installer)

enter image description here

Vengleab SO
  • 716
  • 4
  • 11
0

Android Emulator's previous version seems to be not working with HAXM 7.6.5. If you install the new version of Android Emulator(30.5.6), It will work properly. If it still is not working, you should try cold boot. it worked for me.

Umut ADALI
  • 1,146
  • 1
  • 14
  • 31
0

it happened to me on windows 10 and the problem was in a file system called winspool.drv try to fix this file this what solved the problem for me open cmd in windows and run it as administrator and type this command sfc /scannow it will make a scan and will repair the corrupted file after the scan finished restart your computer and try to run the emulator again

0

You can use Android Emulator Apple Silicon Preview. I tried all other options and nothing works for me.

However this have some limitations currently. Probably will work better in the future.

Currently know issues are explained here as well. https://androidstudio.googleblog.com/2020/12/android-emulator-apple-silicon-preview.html

Here is one good article about this journey and full setup and faced issues with different solutions: https://medium.com/mobile-app-development-publication/my-journey-to-setup-android-emulator-for-m1-macbook-pro-b8365321b3e7

speksy
  • 700
  • 8
  • 13
-3

This has a very simple solution only if the installation process is complete and still the emulator is not launching, Solution: Just try to use older API version or any older stable android API version. In my case the latest version I was having was API-31, but the API-28 worked for me. Change your android API to any older version Try it. This worked for me.