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
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"