The stop button not working and run button is disabled
I am using android studio on Macbook pro with M1 Chip.
I downloaded the M1 chip-optimized Android studio.
When I run the flutter project on the Android emulator with Android Studio,
It runs fine but after some time If I try to stop the app. It does not stop and if I try to reload it, the reload button becomes disabled.
If I use the IOS emulator, I do not get this issue.
It only happens when I run my flutter project on Android emulators or Real Android devices.
3
Answers
Encountered the same issue on M1 Android Studio. Had to force kill the Android Studio process more often.
However, I didn’t encounter that issue after updating Android Studio to "2020.3.1 Patch 4" version.
Flutter dev on an M1 machine feels like a hot mess right now. Along with the stop button not working, there are several other related issues I keep running into including multiple dart processes being created in Activity Monitor, getting stuck on building, freezing and the emulator restarting. This requires constant force killing of Android Studio, restarting the emulator and re-building.
One thing I’ve found that seems to help a lot is making sure the emulator has focus after applying your changes. I have two monitors and keep the emulator on a second screen, so previously I would just run/stop/apply changes in Android Studio and wait for the emulator to update but it would just hang. I noticed that if you cmd + tab to the emulator to give it focus then the changes are applied. For some reason if focus is kept on Android Studio, nothing happens.
It’s not perfect, I’m still running into a lot of issues, but it has helped a lot.
Dart officially supports Apple Silicon, but the one which is bundled with Flutter SDK works with Intel.
I managed to replace it with the Apple Silicon compatible version using flutter_m1_patcher. There are more ways to replace it which you can find here:-
How to replace the bundled Dart SDK in Flutter to run natively on Apple Silicon (ARM64)?
After doing this, I have not faced this stop button issue from last three days. Will update here in case I face the problem again.
Update (15/02/2022)
Life is great after this. Resolves problem for me.
Update (25/05/2022)
Flutter 3 now have Apple M1 compatible Dart SDK bundled into it. Issue is resolved.