두 개의 Android Gradle 모듈이있는 프로젝트가 있습니다. 하나는 라이브러리 :mylib
이고 하나는 앱 :demo
입니다. build.gradle
for :demo
에서 다음에 대한 종속성을 추가했습니다 :mylib
.
dependencies {
compile project(':mylib')
}
차례로 다음과 :mylib
같은 종속성이 있습니다.
dependencies {
compile 'com.google.code.ksoap2-android:ksoap2-android:3.5.0'
}
저장소가 올바르게 설정되고 프로젝트에 모듈을 :mylib
추가하기 전에 잘 구축되었습니다 :demo
. 하지만 이제 빌드 할 때 다음과 같이 표시됩니다.
Error:Gradle: A problem occurred configuring project ':demo'.
> Could not resolve all dependencies for configuration ':demo:_debugCompile'.
> Could not find com.google.code.ksoap2-android:ksoap2-android:3.5.0.
Searched in the following locations:
https://jcenter.bintray.com/com/google/code/ksoap2-android/ksoap2-android/3.5.0/ksoap2-android-3.5.0.pom
https://jcenter.bintray.com/com/google/code/ksoap2-android/ksoap2-android/3.5.0/ksoap2-android-3.5.0.jar
file:/home/kevin/local/android-sdk-linux/extras/android/m2repository/com/google/code/ksoap2-android/ksoap2-android/3.5.0/ksoap2-android-3.5.0.pom
file:/home/kevin/local/android-sdk-linux/extras/android/m2repository/com/google/code/ksoap2-android/ksoap2-android/3.5.0/ksoap2-android-3.5.0.jar
file:/home/kevin/local/android-sdk-linux/extras/google/m2repository/com/google/code/ksoap2-android/ksoap2-android/3.5.0/ksoap2-android-3.5.0.pom
file:/home/kevin/local/android-sdk-linux/extras/google/m2repository/com/google/code/ksoap2-android/ksoap2-android/3.5.0/ksoap2-android-3.5.0.jar
Required by:
MyProject:demo:unspecified > MyProject:mylib:unspecified
왜 ksoap2 :demo
를 :mylib
사용하는지 알고 있는지 이해하지 못합니다. 왜 종속성 자체를 해결하려고 시도하는지는 말할 것도 없습니다. 난 아무것도 생각하지 않습니다 public
또는 protected
에서 :mylib
그 ksoap2의 사용을 노출가.
module을 포함하고 있기 때문에 gradle은 중첩 된 모든 종속성 (pom 파일과 유사한 것)을 해결하려고합니다 .
라이브러리 com.google.code.ksoap2-android
는 jcenter 또는 maven 중앙 저장소에 없으며 문제의 원인입니다.
gradle이이 라이브러리를 찾을 수있는 저장소를 추가하기 만하면됩니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다