Stop Button not working for flutter in Android studio - android

The stop button not working and run button is disabled
See the following picture:
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.

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.

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.

Related

Android studio 4.1 emulator crash

I just upgraded my android studio to 4.1 version:
And tried to run some project on this emulator:
And for some reason, this specific emulator is crashing my android studio, I have noticed that I am getting an error:
After reading about the subject, I uninstalled "Riot Vanguard" but it did not solve my problem.
More info (and partially solving the problem ) can be found in "Update" at the bottom of the question.
In addition, moments after my android studio will get closed I will get a windows blue screen (happens every time).
I didn't have this problem earlier with android studio below 4.1 version, why is this happening?
Update (problem solved for others emulators)
I have run into the same problem on other emulators as well, but I could open those emulators so I could fix the problem:
Solution 1
According to most threads that I have run into, You will need to disable or uninstall "Riot Vanguard":
Open task manager, go to the startup tab, right click on Riot Vanguard, and press disable
Solution 2
If step 1 didn't fix the problem you may want to enable developer mode on your emulator.
For some reason with android studio 4.1 android studio could not find the emulator (It will tell you that there are "No connected devices") without enabling the developer mode
Before Android studio 4.1 version I didn't need to enable the developer mode to run projects on emulators and this is what solved the problem for other emulators for me.
BUT
Although I don't have any problems with other emulators at all I still can`t even open Pixel_3a_API_30c68 emulator without it crashing
How can I fix this problem on the specific emulator?
Update 2
The problem still occurs even After updating android studio to 4.1.1
Without having "Riot Vanguard" I also could not run any emulator in Android Studio since I upgraded to version 4.1. After some hours I finally found out what caused the problem (in my case):
"Android SDK Tools" have been replaced by other SDK tools (which ?) and is obsolete now. As soon as I UNINSTALLED "Android SDK Tools" the emulator worked again.
I would be interested to know if the java version makes a different. I moved from Windows to Linux because of problems running the emulator.
Linux worked great until I moved to Android Studio 4.1. So check java and it was version 11. Changed to java8 and it worked straight first time.
Seem to remember there was a setting in Android Studio to set the SDK which I think was version 8. But can no longer find this in settings in Studio 4.1.
Updating to the latest system image of the SDK helped me.

My mac suddenly freezes while using Android Studio 3.2

I am doing the Android Basics: Data Storage course on Udacity, and I have almost finished this course, but since about a week ago while using Android Studio and doing everything that the course teaches me to do, at some point Android Studio completely freezes my Mac OS and that forces me to reboot my computer.
This problem happens at any time, literally. There wasn't anything special that Android Studio was trying to do when this happened. Many times I have been just writing some code, and it freezes, not running the project, downloading something in the app or checking anything special, it just suddenly freezes.
I am using Android Studio 3.2 (latest version) in a MacBook Pro (13-inch, Early 2011). It also happened before I update it to Android Studio 3.2, when I had the previous version I thought I could be fixed by delete Android Studio and download the latest version, but it did not work.
I have a solution for this problem.
I seem to have a problem occurs with the Java version of Android Studio crashes
So check your Java version. I think you are using JAVA 1.8
Please remove all java on your system like below.
sudo rm -rf /Library/Java/JavaVirtualMachines/jdk1.8.0_80.jdk/
then download and reinstall latest java 1.8
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
I will hope you can resolve this problem
If your machine freezes, it could be due to either you open too many apps that consume much RAM with Android Studio, hence when Android Studio needs some more RAM to operate (i.e during gradle build or instant run), the machine could not provide sufficient RAM hence, Android Studio will freeze: or your machine does not meet minimum system requirements for Android Studio, for this information, you can check the official documentation https://developer.android.com/studio/ . Also, in order to manage memory usage, have a look on this link https://macpaw.com/how-to/reduce-memory-usage-on-mac
I had something similar after updating to 3.2.
Wasted 4 hours trying to fix it and eventually followed these instructions to totally wipe AS from my PC.
How to completely uninstall Android Studio from windows(v10)
I understand that you have MacOS but it wouldn't be too difficult to locate the directories there.
For those who are looking for a solution when is using tabs just is because
Android Studio freezes on macOS Big Sur. On machines running macOS Big Sur, Android Studio 4.1 might freeze when you open a dialog.
To work around this issue, do one of the following:
Go to the Apple Menu, select System Preferences > General. In the Prefer tabs when opening documents option, select "never". Then restart Android Studio.
Upgrade to Android Studio 4.2, currently available in the Beta channel.
Otherwise, wait for the Stable Android Studio 4.2

Android Studio 2.2.3 freeze when launching

When i try to run Android Studio it gets suspended and not launching.
Link to screenshot
I've tried several things such as:
Cannot start Android Studio. Android Studio stuck at the splash screen
Currently it is not working. It happens to me several times, and i always uninstall it and install older version - then it works. It is really annoying solution, how get this working correctly by not using my solution?
My OS is Windows 7 x64.
Try deleting .AndroidStudio2.3 folder or any version of it from this location C:\Users\UserName\.

Android App not loading in Emulator after Android Studio 2.3 Update

I have just uploaded my Android Studio version to 2.3, and I am now having problems testing my app in my emulator. It is a Nexus 5X emulator with Android 7.0 Nougat loaded on it (API 24), with an ABI: armeabi-v7a (I have an AMD processor, so to the best of my knowledge I can only use this). Before, it was a bit slow and would sometimes come up with a 'Not Responding' error, but clicking 'Wait' would always do the trick.
After the Android Studio update, when I press 'Run', it opens up & boots the emulator. However, once booted, it gets stuck on the "Launching App - Installing APKs" process. It probably shows that it is doing this for about 2 minutes, before stopping. It then shows "Launching Instant Run Service" for a few seconds. The green 'run' arrow then becomes active again, as if there is no emulator open. The emulator is open, but there is no app. If I click the green 'run' arrow with the emulator already open, it does a gradle build sync & then doesn't even attempt to launch the app/install APKs - it only says "Launching Instant Run Service" for a few seconds, even though nothing happens.
I have tried removing the emulator & recreating it, and I have also tried fiddling with some of the parameters as suggested in other posts which concern similar (but not identical) issues to this. The first time I tried to run the app on the emulator after the update, I had many messages pop up in the event log, saying Android Studio Can't Bind to Local 86xx for debugger, whilst the Android Device Monitor was opened. Ever since then, with the ADM closed, I have had the problem described above, with no error messages showing in the error log.
Any help with this issue would be very much appreciated - please note it concerns the very latest version of Android Studio which I have only just had a popup requesting that I install. Build Tools Version in build.gradle has also been updated from 24.0.2 to 25.0.0.
If you haven't already done it:
Open Tools -> Android -> SDK Manager
Select tab SDK Tools, flag Android Emulator (version 27.0.5 at the moment) and Apply
This solution worked for me, hope this can help
I tried all of the aforementioned and it didn't help. What helped was disabling Instant Run in Settings -> Build, Execution, Deployment -> Instant Run.
Relevant issue in AOSP bugtracker: https://code.google.com/p/android/issues/detail?id=235879
Updating the Java SDK solved the problem for me.
you need to download the Android Emulator for Android Version 2.3 or make sure when you updated your AS from 2.2 to 2.3 all these components got updated and installed. I had the same problem and i just downloaded the Android emulator and it worked fine for me.
had the same problem, after two days of trying to solve this, i decided to uninstall android studio, and then install the new virsion 2.3 all over again, now Emulator working just fine!
*not much of programming, but it did the job!
Don't worry about updating anything. For some reason upgrading to 2.3 makes the default setting for running your app set to "androidDependencies" which does nothing except give you strange errors. Just go to Run -> Edit Configurations and in the window that pops up try to delete with the minus symbol the selection on the left pane with the task called android dependencies. Then click on "app" under the "Android App" expandable arrow at the top. (see the pic)
edit configuration window
I recently download Android Studio 2.3 and installed default components and some Android OS for emulator. When I use an emulator (version 26.0.0) I have problem with its sound and image (display is very poor).
I'm using Ubuntu 16.04.2, Kernel 4.8 and KVM is setup.
It's an example of my problem:
I think you've not enabled the developer settings in your emulator. Sometimes after update the emulator is reset and all the settings are lost. Enabling it, should solve the problem.

Is there an alternative Android emulator for Visual Studio on Windows 10 Home

When using Visual Studio 2015 to develop c++ for Android the emulator only works if you are running a Pro version of Windows, for those using Visual Studio Community who are probably also running on a Home version of windows (like me) the Emulator will not work.
Is there an alternative available that can integrate with the VS debugger?
*** Edit
I have been looking at this list Android emulators although this seems to be aimed at android gaming on PC rather than App development. So was wondering if anyone had managed to integrate one of these with Visual Studio?
Both the below options come with the caveat that I have not used either.
Xamarin Android Player
Apparently Xamarin had issues with the default Android Emulator. Primarily that it was slow, and clunky, and they were getting a lot of complaints about it from Xamarin users (despite it not being their product/fault).
They decided to create their own emulator to get around this, and it can be found here.
It should be noted that (at time of writing) this is still in Preview by the looks of things. So bugs may be present.
From what I can see on the download page, it doesn't appear like you need Xamarin to actually use it. In any case, it's worth a shot.
GenyMotion
Another option is GenyMotion. There is a free version for personal use only (with limited functionality), or a paid option that provides more capability.
Android player link has changed to here: https://developer.xamarin.com/releases/android/android-player/
I had problems starting the android VMs, even after restarting the host. There seems to be some incompatibilities between Windows 10 Home and Virtualbox 5.0.4 that Android player installs. Installing Virtuallbox 5.1.2 after installing Android player seems to have resolved this.
EDIT: I haven't had a chance to test integration with Visual Studio yet.
Everything seems to be working as expected within Visual Studio. Both of the VM devices I created in Android Player are visible in the drop down of the run menu. Visual Studio will start the selected VM when I debug the default blank android app.
The only hiccup is that Visual Studio doesn't wait long enough for the emulator to start before attempting to deploy the app. So I have to start the run again or remember to start the VM from Android Player before debugging.

Categories

Resources