I have a library project that includes an active android using Gradle. To make it work, I have to add
compile 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT'
and add the repository for it like this:
repositories { maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } }
However, if I do this in a library project, I get an error message:
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 add my library module as follows:
dependencies { compile project(':common') compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:21.0.3' }
To remove this error, I must add the repository to the main application module 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 repositories defined only in the library project, without the need to add the repository to the main application module? I just want the library module to look after itself.
source share