I hope this saves someone some hours of pain. If you are still having problems, you may need to set the Project SDK. after sync is complete, go back and check the box of android sdk platform-tools (this will install a fresh one with new adb.exe) wait till it is done and sync project and then you are good to go.
(this will uninstall the platform tools from your ide) wait till it is done and then your gradle will sync. First, launch the web browser that you prefer and then visit the official website of Avast. Windows=> c://Users/johndoe/AppData/local/android (you can now see the sdk.)