As per some of the above, go to File -> Project structure, in the first two fields I entered the most recent Gradle version and Android Plugin Version and click OK, and then wait. The whole process may take half an hour, but keep clicking the blue hyperlinks and they will get it done for you!