The problem is indeed the long file path. However, instead of moving your project, you could change the build directory for your project. This should solve the issue.
In your root build.gradle add:
allprojects {
buildDir = "C:/tmp/${rootProject.name}/${project.name}"
repositories {
...
}
}