I have a library project that includes active android using Gradle. To get it to work I have to add
compile 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT'
and add the repository for it like so:
repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
However if I do this in the library project, I get the error:
Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
> Could not find com.michaelpardo:activeandroid:3.1.0-SNAPSHOT.
Searched in the following locations:
https://jcenter.bintray.com/com/michaelpardo/activeandroid/3.1.0-SNAPSHOT/maven-metadata.xml
https://jcenter.bintray.com/com/michaelpardo/activeandroid/3.1.0-SNAPSHOT/activeandroid-3.1.0-SNAPSHOT.pom
https://jcenter.bintray.com/com/michaelpardo/activeandroid/3.1.0-SNAPSHOT/activeandroid-3.1.0-SNAPSHOT.jar
file:/Users/user/AndroidSDK/extras/android/m2repository/com/michaelpardo/activeandroid/3.1.0-SNAPSHOT/maven-metadata.xml
file:/Users/user/AndroidSDK/extras/android/m2repository/com/michaelpardo/activeandroid/3.1.0-SNAPSHOT/activeandroid-3.1.0-SNAPSHOT.pom
file:/Users/user/AndroidSDK/extras/android/m2repository/com/michaelpardo/activeandroid/3.1.0-SNAPSHOT/activeandroid-3.1.0-SNAPSHOT.jar
file:/Users/user/AndroidSDK/extras/google/m2repository/com/michaelpardo/activeandroid/3.1.0-SNAPSHOT/maven-metadata.xml
file:/Users/user/AndroidSDK/extras/google/m2repository/com/michaelpardo/activeandroid/3.1.0-SNAPSHOT/activeandroid-3.1.0-SNAPSHOT.pom
file:/Users/user/AndroidSDK/extras/google/m2repository/com/michaelpardo/activeandroid/3.1.0-SNAPSHOT/activeandroid-3.1.0-SNAPSHOT.jar
Required by:
Condeco:app:unspecified > Condeco:common:unspecified
I am adding my library module like so:
dependencies {
compile project(':common')
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
}
To remove this error I have to add the repository to the main app module as well in the same way:
repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
When I do this the project compiles fine.
Can I get my project to compile with the repositories defined only in the library project without having to add the repository to the main app module? I just want to have the library module look after itself.