Stop Button not working for flutter in Android studio
Asked Answered
A

3

10

The stop button not working and run button is disabled

See the following picture: enter image description here

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.

Antagonistic answered 25/10, 2021 at 6:13 Comment(10)
This is not the issue of code. Whenever I run any Flutter Project. After some time I cannot stop or reload the app and have to force quit it. Happen only when I run the app on Android (emulator or real device). It works fine on IOS simulator.Antagonistic
I confirm that this is a very ANNOYING BUG. It often occurs on Flutter + Mac M1. I always have to kill Android Studio process because of this.Effervescent
@HuyNguyen I am also facing same issue in M1 Mac. Did you able to find a solution or workaround?Navarre
@RissmonSuresh My temporary solution is killing Android Studio process from Activity Monitor (find Android Studio then force quit it)Effervescent
@HuyNguyen Try Intellj Community edition. I am not getting issue in IntelliJ IDE Community edition.Navarre
@RissmonSuresh Thank for yr suggestion but I'm already familiar with Android Studio, and it has many plugins I'm usingEffervescent
Same - anytime i lose connection due to any reason I cannot just stop and start. I have to force quit Android studio first and then it will allow me to start the application, flutter + m1 mac.Forsta
when u run your app in console you have one tab open close it by pressing x signInsignificance
This problem is still now for M1 apple processors and working in solution till now.Spinning
The solution I have given works. Bundled Dart SDK is Intel version, we need to use Apple Silicon version.Tiv
T
2

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.

Tiv answered 9/2, 2022 at 10:0 Comment(0)
B
0

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.

enter image description here

Bergerac answered 1/1, 2022 at 2:39 Comment(4)
Not really, I still encountered it once even on 2020.3.1 Patch 4.Bergerac
I'm still encountering this on 2020.3.1 Patch 4 as wellRakes
facing same problem.Tiv
Hmm, facing the same problem on M1.Bugle
R
0

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.

Rakes answered 5/2, 2022 at 15:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.