I've tried everything and in the end my problem was that my emulator was not connected to the internet, so make sure to check that! I followed the instructions here to solve the problem:
If you are on Mac - try this - GoTo Apple Icon -> System Preferences -> Network Click on the gear icon on the and select 'Set Service Order' Bring the active interface before other interface. Restart the Android Emulator.