這裏是我的應用模塊「應用」的gradle建設如何看起來像:搖籃插件「com.android.library」不自定義Maven倉庫搜索
apply plugin: 'com.android.application'
repositories {
maven { url 'http://localhost:8080/repository/internal/' }
}
...
dependencies {
compile 'org.apache.httpcomponents:httpmime:4.2.3'
compile 'com.testpackage.networking:networking:1.0.3'
}
和它工作得很好。我試圖在名爲'librarymodule'的庫模塊中使用相同的依賴項。下面是它的build.gradle的樣子:
apply plugin: 'com.android.library'
repositories {
maven {
url 'http://localhost:8080/repository/internal/'
}
}
...
dependencies {
compile 'org.apache.httpcomponents:httpmime:4.2.3'
compile 'com.testpackage.networking:networking:1.0.3'
}
唯一的區別是gradle這個插件「com.android.library」這裏使用VS在「應用」模塊中使用「com.android.application」。
Error:A problem occurred configuring project ':app'. Could not resolve all dependencies for configuration ':app:_debugCompile'. Could not find com.testpackage.networking:networking:1.0.3. Searched in the following locations: https://jcenter.bintray.com/com/testpackage/networking/networking/1.0.3/networking-1.0.3.pom https://jcenter.bintray.com/com/testpackage/networking/networking/1.0.3/networking-1.0.3.jar file:/Users/myusername/Library/Android/sdk/extras/android/m2repository/com/testpackage/networking/networking/1.0.3/networking-1.0.3.pom file:/Users/myusername/Library/Android/sdk/extras/android/m2repository/com/testpackage/networking/networking/1.0.3/networking-1.0.3.jar file:/Users/myusername/Library/Android/sdk/extras/google/m2repository/com/testpackage/networking/networking/1.0.3/networking-1.0.3.pom file:/Users/myusername/Library/Android/sdk/extras/google/m2repository/com/testpackage/networking/networking/1.0.3/networking-1.0.3.jar Required by: LibrariesApplication:app:unspecified > LibrariesApplication:librarymodule:unspecified
所以,出於某種原因沒有http://localhost:8080/repository/internal/com/testpackage/networking/networking/1.0.3/networking-1.0.3.pom搜索在以下位置列表下。
這不僅是我的存儲庫問題。我能夠例如使用
maven { url 'https://mint.splunk.com/gradle/' }
庫與依賴
compile 'com.splunk.mint:mint:4.1'
但還是收到類似的錯誤
有誰知道如何解決這個問題?
這讓我解決一個行家回購罐子的依賴度在尋找另一 –