may be the generated Q-classes were being stored in an unexpected location or not accessible during your project's build process add this line
tasks.withType(JavaCompile) {
options.annotationProcessorGeneratedSourcesDirectory = file("$buildDir/generated/sources/querydsl")
}