Maybe unrelated to the original reason in this question, but for those who would face same with gradle and local module dependency
dependencies {
checkstyle project(":module")
}
this error could happen, if module doesn't contain group and version, so in the module/build.gradle
just need to be specified
plugins {
id 'java-library'
}
group = "com.example"
version = "master-SNAPSHOT"