One possible reason for the occurrence of this error is due to the difference in adb versions in the development machine and the connected connected device/emulator being used for debugging.
So resolution is:
Run on terminal/command prompt following commands:
adb kill-server
adb start-server
This will start the adb successfully. Now you can connect device. Hope it helps.