Fix buildscript.gradle which wasn't working because the variables were not defined in the correct scope.
Upgrade Gradle version to 1.11.