Reputation: 22008
Just trying Android Studio & Gradle and I want to add Roboguice to my Project, this is my build.gradle
:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.8.+'
}
}
allprojects {
repositories {
mavenCentral()
}
}
dependencies {
compile 'org.roboguice:roboguice:2.0'
}
gives me
Gradle 'TestApp' project refresh failed:
Build script error, unsupported Gradle DSL method found: 'compile()'!
I tried to move the line
compile 'org.roboguice:roboguice:2.0'
within the dependencies
in buildscript
but that also failed.
How is this done correctly?
Upvotes: 2
Views: 7414
Reputation: 363459
dependencies {
compile 'org.roboguice:roboguice:2.0'
}
Move this part from build.gradle in root (top level build file) to build.gradle in your module
Upvotes: 6