I would like to use Roboguice in an Android project using Android Studio and Gradle. I have been following their installation guide but I'm new to both Gradle and Android Studio, and I'm not sure how the pieces fit together.
Essentially, I've changed app's build.gradle
file include something like;
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'org.roboguice:roboguice:3.+'
provided 'org.roboguice:roboblender:3.+'
}
After syncing the changes in Android Studio, I'm expecting to access RoboActivity
and the like, but I can't find the references.
Can anyone explain what's going on?
Thanks, Matt
I decided to read up more about Gradle and how it works. Ultimately, I found quite a few references to mavenCentral()
and jcenter()
repositories.
Both mavenCentral and jcenter are java-based package repositories (a bit like Nuget for .NET).
I'm guessing that Roboguice isn't available in jcenter, because if you use mavenCentral, everything appears to work. In order to change your repository, you change your project-level gradle.build
file.
// 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:1.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenCentral()
}
}