我有两个AAR,我想将它们打包到一个库中并上传到Maven。这两个AAR之间的关系为。
该库的结构如下:
LibraryA
--- AAR1
--- AAR2
LibraryA的build.gradle中的依赖项为
dependencies {
compile project(':AAR1')
compile project(':AAR2')
}
但是当我在新项目中使用LibraryA时。我收到无法找到AAR1和AAR2的错误
错误消息是这样的:
Failed to resolve: AAR1
Failed to resolve: AAR2
如果我使用的是transitive = true
compile ('com.example.LibraryA:1.0.0@aar') {
transitive=true
}
错误是无法在AAR1和AAR2中找到aatr或主题资源。
任何建议将不胜感激
编辑:
LibraryA的settings.gradle
include ':app', 'AAR1', 'AAR2'
最佳答案
LibraryA在您的Maven存储库中,AAR1和AAR2也在Maven存储库中吗?
1.将AAR1和AAR2发布到Maven
2.使用以下依赖项将LibraryA重新发布到Maven:
dependencies {
compile 'com.example.AAR1:1.0.0'
compile 'com.example.AAR2:1.0.0'
}
如果您不想这样做,也许您需要使用https://github.com/adwiv/android-fat-aar来做个胖子
关于android - 如何将多个AAR bundle 到Maven,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48062806/