Gradle was forced to close the connection by the remote host Unable to open connection to: localhost/127.0.0.1:5037

Since the computer has not been turned off before, Android Studio has been on, and the Android emulator has been on. The next day I wanted to execute the following procedure, so I synced, but I did not expect that the connection was forced to close remotely.
After this happened, I found some articles, saying that it was caused by the fact that the network connection in some code was not closed.
But after I restarted AndroidStudio, the problem was solved. It may be the problem of port occupation or adb closed. Please record it first.
This description appeared in the EventLog: ADB rejected shell command, so I still consider closing and restarting the Android emulator and AndroidStudio.

Guess you like

Origin blog.csdn.net/poolooloo/article/details/105684042