During Google I/O 2016\'s What\'s new in Android development tools a great new feature was quickly mentioned: Android Gradle plugin can now automatically download missing depend
I did:
gradle --refresh-dependencies
on the terminal, and it solved the problem.