I can't comment on @profimedica answer (due to low reputation of my account, but already upvoted). Just want to say that:
Just add the compileClasspath as a configuration name to your build.gradle
... works perfectly. Thank you.