Can't import or create Gradle project

If I create a new Gradle project, after the project opens there is a "Messages Gradle Sync"
message box which has an error message: "Gradle 'xyproject' project refresh failed. Build script error, unsupported Gradle DSL method found: 'mavenRepo()'!

I get this same error if I try to import a Gradle project. Using IU-138.1283.4


Looks like the problem was coming from my init.gradle file. So it is working now.