The issue was in the dependencies of the gradle.build file.
Changed the following lines in gradle.build from:
dependencies {
groovy 'org.codehaus.groovy:groovy:2.2.2'
...
to:
dependencies {
groovy 'org.codehaus.groovy:groovy-all:2.2.2'
...
This resolved the issue.