title: Why is my gradle build failing? (could not find method apt())
body: <p>Everything works perfectly fine until I try to use the apt or other plugins with gradle for my annotation processor that I'm writing. I've been able to build and run everything manually (with/without gradle), but having problems as soon as I introduce plugins.  Here's my script:</p>
  
  <p>Here is my buildscript:</p>
  
  <pre><code>buildscript {
  
      evaluationDependsOn('compiler')
      evaluationDependsOn('core')
  
      repositories {
          maven { url "https://plugins.gradle.org/m2/" }
          flatDir { dirs './make' }
      }
  
      dependencies {
          classpath "net.ltgt.gradle:gradle-apt-plugin:0.9"
          classpath ':core:0.1'
          apt ':compiler:0.1'
      }
  }
  
  plugins {
      id 'java'
      id 'idea'
      id "net.ltgt.apt" version "0.9"
  }
  
  group 'bundle'
  version '0.1-SNAPSHOT'
  </code></pre>
  
  <p>I'm using the <a href="https://github.com/tbroyer/gradle-apt-plugin" rel="nofollow noreferrer">gradle-apt-plugin</a>.  I've also tried using <a href="https://github.com/palantir/gradle-processors" rel="nofollow noreferrer">Palantir's annotation processing plugin</a> and the exact error is thrown, leading me to believe that it is nothing wrong with the plugins and something with my configuration and/or versions.</p>
  
  <p>local gradle version: 2.1
  and
  Gradle wrapper: 3.4.1</p>
  
  <p>Annotation processing is enabled in Intellij.  I've also checked that I use the correct URL for the remote plugin repositories.  I've tried rolling back the gradlew version.</p>
  
  <p>Intellij warns me that "Unindexed remote maven repositories found" but according to the idea forums <a href="https://youtrack.jetbrains.com/issue/IDEA-102693" rel="nofollow noreferrer">it's a bug but won't affect a build.</a>  Other than that, I have no idea what's making this fail.</p>
  
  <p>Here's the output: </p>
  
  <pre><code>FAILURE: Build failed with an exception.
  
  * Where:
  Build file '/home/$USER/IdeaProjects/$PROJECT/build.gradle' line: 14
  
  * What went wrong:
  A problem occurred evaluating root project 'Dynamic-MVP'.
  &gt; Could not find method apt() for arguments [:compiler:0.1] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
  </code></pre>