I spent around a complete day to look for the solution but couldn't find an exact one.
Finally what i did was that I uninstalled my antivirus and after that it worked like a charm.
So, here I shortlist the steps to check whether you are solving for the correct problem or not:-
- Run command prompt and set path to where adb.exe file is present. (In most of the cases it's found at C:\Users\YOUR_USERNAME\AppData\Local\Android\Sdk\platform-tools)
- Type
adb start-server and press enter.
- If there is an error displayed saying something like "Cannot connect to daemon" , then you must look in your antivirus for firewall settings and add the path to its exceptions or you can simply uninstall your antivirus.