Android emulator randomly crashing on Apple M2 Chip EXC_BAD_ACCESS / KERN_INVALID_ADDRESS
Asked Answered
B

1

9
Operating system: Mac OS X
                  13.2.1 22D68
CPU: arm64
     12 CPUs

GPU: UNKNOWN

Crash reason:  EXC_BAD_ACCESS / KERN_INVALID_ADDRESS
Crash address: 0x202922776f646e51
Process uptime: 6125 seconds

Thread 0 (crashed)
 0  libc++.1.dylib + 0x1f40c

Android emulator (not my app) is randomly crashing on M2 chip with the error above, both for flutter apps and native apps.

I tried

  1. Reinstall android studio and emulators.
  2. Give android studio more heap size.
  3. Give emulator more heap size. (It took longer to crash)
  4. Create new emulator.
  5. Cold start emulator.
  6. Use different Android version
  7. Use different config (Ram screen size)
  8. Use different image.

This also has not helped OSX: Android Emulator Crashes

Issue is not happening on other developers using M1 chips, but I am unsure if it is related or not.

Full crash log: https://mclo.gs/7Dx06Ym (It is very long)

I'm using

macOS Ventura 13.2.1 (22D68)
Android Studio Flamingo | 2022.2.1
Build #AI-222.4459.24.2221.9862592, built on March 31, 2023
Runtime version: 17.0.6+0-17.0.6b802.4-9586694 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Backfield answered 21/4, 2023 at 14:22 Comment(0)
B
4

Launching and using the emulator inside the android studio, rather than standalone application worked for me.

Go to Settings -> Preferences -> Emulator -> check "Launch in a tool window". I don't like using the emulator on device manager but will stick with it for now.

Please comment why this solution works if you know.

Backfield answered 23/4, 2023 at 18:23 Comment(6)
Found any better solution to it? I'm tired of using android studio I want to go back to vscodeHunks
@AhmadHassan no I'm afraid, just keep using the emulator in android studio.Backfield
@AhmadHassan I using the answer to this question for the workaround, #70876904 following this instruction developer.android.com/studio/emulator_archive to downgrade the emulator versionElvaelvah
Why not use it inside Android Studio rather than downgrading?Backfield
@EmreAkcan smaller screen overall because android studio has borders and all, less control and android studio is heavy too. It doesn't feels comfortable.Hunks
The solution for me was to "report the issue". The first few times with different API versions, the emulator crashed. It's a very strange issue!Merchandising

© 2022 - 2024 — McMap. All rights reserved.