我试图在maven上公开一个android库,这个工件包含另外三个模块,每个模块都是一个aar文件,这意味着它有字符串,布局资源。库A的结构是:
+ Library A
-- Module 1
-- Module 2
-- Module 3
在库A的build.gradle中,我使用
包含这三个模块compile project (:module1);
compile project (:module2);
compile project (:module3);
但是当我在新项目的gradle中使用这个库时,它找不到所有的子模块。错误消息是:(假设所有模块版本都是1.0)
Could not find module1:1.0
Searched in the following locations:
file:/Users/chan/Documents/AndroidSDK/sdk/extras/m2repository/project/modules/widgets/module1/1.0/module1-1.0.pom
file:/Users/chan/Documents/AndroidSDK/sdk/extras/m2repository/project/modules/widgets/module1/1.0/module1-1.0.jar
file:/Users/chan/Documents/AndroidSDK/sdk/extras/google/m2repository/project/modules/widgets/module1/1.0/module1-1.0.pom
file:/Users/chan/Documents/AndroidSDK/sdk/extras/google/m2repository/project/modules/widgets/module1/1.0/module1-1.0.jar
file:/Users/chan/Documents/AndroidSDK/sdk/extras/android/m2repository/project/modules/widgets/module1/1.0/module1-1.0.pom
file:/Users/chan/Documents/AndroidSDK/sdk/extras/android/m2repository/project/modules/widgets/module1/1.0/module1-1.0.jar
https://maven.google.com/project/modules/widgets/module1/1.0/module1-1.0.pom
https://maven.google.com/project/modules/widgets/module1/1.0/module1-1.0.jar
https://maven.com/artifactory/libs-release-local/project/modules/widgets/module1/1.0/module1-1.0.pom
https://maven.com/artifactory/libs-release-local/project/modules/widgets/module1/1.0/module1-1.0.jar
https://repo1.maven.org/maven2/project/modules/widgets/module1/1.0/module1-1.0.pom
https://repo1.maven.org/maven2/project/modules/widgets/module1/1.0/widgets-unspecified.jar
module2和module3的错误相同。
我不知道为什么它找不到模块。
库A在新项目中配置:
compile ('LibraryA:1.0@aar') {
transitive=true
}
以下是我到目前为止所尝试的,没有运气:
任何建议都会非常感谢!