GRADLE - You must specify at least one directory for a flat directory repository
<p>I'm trying to build a <code>gradle 2.11</code> project in <code>Intellij</code> and I keep getting this error kicked back to me. I'm setting a <code>flatDir</code> in the build.gradle file but this error is still coming up when I run <code>gradle idea</code>.</p>

<pre><code>buildscript {
  repositories {
    flatDir {
      dirs "$rootProject.rootDir/lib/gradle-plugins"
    }
  }
  dependencies {
    classpath "gradle.plugins:prompt-version-plugin:1.0.0"
    classpath "gradle.plugins:properties-plugin:1.0.0"
  }
}
idea {
    module {
        /*
         * If you omit [ ] around, it fails with: Cannot change configuration ':provided' after it has been resolved
         * This is due Gradle 2.x using Groovy 2.3 that does not allow += for single elements addition.
         * More: https://discuss.gradle.org/t/custom-provided-configuration-not-working-with-gradle-2-0-rc2-in-multi-project-mode/2459
         */
        scopes.PROVIDED.plus += [configurations.provided]
        downloadJavadoc = true
        downloadSources = true
    }
}
</code></pre>

<p><strong>Error</strong></p>

<pre><code>* What went wrong:
Execution failed for task ':ideaModule'.
&gt; You must specify at least one directory for a flat directory repository.
Is there another place to set the flat directory?
</code></pre>