After upgrading to Gradle 2.0: Could not find property ‘Compile’ on root project May 11, 2023 by Tarik Changing the line to tasks.withType(JavaCompile) { options.encoding = "UTF-8" } fixed the issue.