5
我有一個包含使用Gradle的活動android的庫項目。 爲了得到它的工作我要補充當活動Android包含在庫中時,無法解析Gradle中的活動android依賴項
compile 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT'
,並添加存儲庫它像這樣:
repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
但是,如果我這樣做,在庫項目中,我得到的錯誤:
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
我加入我的庫模塊,像這樣:
dependencies {
compile project(':common')
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
}
當我做這個項目編譯好
repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
:0
要刪除這個錯誤我到存儲庫添加到主應用程序模塊以及以同樣的方式。
我可以使用僅在庫項目中定義的存儲庫來編譯我的項目,而無需將存儲庫添加到主應用程序模塊嗎?我只是想讓圖書館模塊照顧自己。
你試過添加'mavenCentral()'嗎? – 2015-02-10 16:48:14
是的,我有。我仍然需要將它添加到主項目模塊和庫項目中。我只想把它添加到圖書館。 – MungoRae 2015-02-10 16:49:32
@MungoRae你有沒有找到解決這個問題的方法?我想做同樣的事情。 – Alan 2015-03-09 17:12:27