3

So, I am trying to run an emulator in Android Studio using the AVD Manager, however it never loads my app in the emulator and when I check flutter doctor it states that no devices are connected. Also, whenever I have Android Studio open, the following text repeats in the event log until I close Android Studo:

12:47 AM * daemon not running; starting now at tcp:5037

12:47 AM * daemon started successfully

12:47 AM Adb connection Error:An existing connection was forcibly closed by the remote host

12:47 AM Cannot reach ADB server, attempting to reconnect.

12:47 AM error: protocol fault (couldn't read status): Connection reset by peer

12:47 AM 'C:\Users\Danny\AppData\Local\Android\Sdk\platform-tools\adb.exe start-server' failed -- run manually if necessary

I would also like to mention that the emulator was working perfectly fine a week ago, so my computer can handle it, I just did something that broke it. I have also tried replacing my platform-tools folder,re-installing Android Studio, re-installing flutter, using adb kill-server and adb start-server. Nothing seems to work.

edit: also closing adb.exe in the task manager works... but I need to be able to click on it to close it. It pops up in my task manager for half a second then goes away seemingly randomly.

edit #2: instances of adb.exe keep opening and suspending in the task manager. I believe this is the problem but solutions online are not working.

8
  • What happens if you setup a new emulator and try that? Commented Jun 16, 2020 at 9:38
  • @Jaime I've tried using multiple emulators they all say the same thing. Funny enough, this morning it was working. The adb.exe process finally appeared in my task manager, I closed it and opened android studio and it was working! But then, later on in the day, it just stopped working... Commented Jun 17, 2020 at 6:01
  • Maybe its something to do with your Antivirus/Firewall I have found windows is funny with external executables sometimes Commented Jun 17, 2020 at 9:03
  • @Jaime I have disabled my antivirus many times just to see if it was interfering. It never fixed the problem. Commented Jun 17, 2020 at 19:37
  • In my case, it was because of some other Android based device connected to the same LAN. I have switched it off and ADB works fine now with my target device. Maybe, that other device was attempting to obtain the same IP as my target device. Not sure. Commented Jun 20, 2020 at 12:35

2 Answers 2

2

It seems this issue has no exact solution, because the cause of this issue is not same for everyone. However, if you have faced this issue recently in Android Studio Bumblebee (2021.1.1) after updating from Arctic Fox, then the problem might have happened due to adb mDNS for wireless debugging.

To solve this issue, disable mDNS for wireless debugging from here:

Android Studio > Settings > Build, Execution, Deployment > Debugger > Untick "Enable adb mDNS for wireless debugging"

SOURCE: https://stackoverflow.com/a/70941381/1372973

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks! This worked for me. I faced this issue, as you mentioned, after upgrading to Bumblebee.
0

This seems to be an issue with networking on Windows 10. You can try downgrading to gradle 6.1.1 or upgrading to gradle 7.0. Another workaround involves disabling the mobile hotspot on Windows 10. See this GitHub issue thread for more details.

1 Comment

I'm using Gradle 7.2 and still having this problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.