Jamal
Jamal

Reputation: 1361

Warning Adb connection Error:An existing connection was forcibly closed by the remote host

I am getting this warning on the android studio while I connected my redmi note 5 pro and try to run android.

Adb connection Error: An existing connection was forcibly closed by the remote host.

I have tried this

adb kill-server && adb start-server
   remove any adb process in the taskbar
   restart studio, clean and rebuild

enter image description here

Upvotes: 1

Views: 3261

Answers (3)

tronman
tronman

Reputation: 10125

Here's a solution someone else offered:

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: Error: "Adb connection Error:An existing connection was forcibly closed by the remote host"

Upvotes: 3

Heroselohim
Heroselohim

Reputation: 1291

Changing the Android SDK tools folder fixed this issue for me.

Check if you have 2 installations of the Android SDK tools. One could be missing updates.

Instead of using my custom folder of Android SDK tools, I used the one provided with Bumblebee installation.

On your project root > local.properties file set this:

sdk.dir=C:\\Users\\YOUR_USER_NAME\\AppData\\Local\\Android\\Sdk

Also check the PATH variable to remove duplicates or old SDK.

Upvotes: 0

user13531614
user13531614

Reputation:

Below Steps Should Work For You

Disable USB debugging

Disable Developer mode

Unplug the device from the USB cable

Re-enable Developer mode

Re-enable USB debugging

Reconnect the USB cable to your device

It is important you do it in this order.

Upvotes: 2

Related Questions