[Solved] Android emulator randomly crashing on Apple M2 Chip EXC_BAD_ACCESS / KERN_INVALID_ADDRESS – Android

by
Ali Hasan
android android-emulator apple-m1 flutter

Quick Fix: Launch the emulator inside Android Studio, instead of using the standalone application. Enable "Launch in a tool window" in Settings > Preferences > Emulator.

The Problem:

An Android emulator is experiencing frequent crashes on an Apple M2 chip, causing both Flutter and native apps to terminate unexpectedly. The crash logs indicate an EXC_BAD_ACCESS/ KERN_INVALID_ADDRESS error, pointing to an issue with memory access. Despite attempts to resolve the issue by reinstalling the emulator, increasing memory allocation, and exploring various configurations and Android versions, the problem persists. The issue is unique to devices equipped with the M2 chip, as other developers using M1 chips have not reported similar crashes.

Q&A

Is it possible to avoid crashing?

Running the emulator inside Android Studio rather than as a standalone app may prevent crashes.