代码之家  ›  专栏  ›  技术社区  ›  Cheng

如何将多个AAR捆绑到maven

  •  0
  • Cheng  · 技术社区  · 7 年前

    我有两个AAR,我想将它们打包到一个库中并上传到maven。这两个AAR是 相互依赖。 图书馆的结构如下:

    LibraryA
    --- AAR1
    --- AAR2 
    

    构建中的依赖项。图书馆的毕业生是

    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或主题资源。

    如有任何建议,将不胜感激

    编辑:

    设置。图书馆毕业生a

    include ':app', 'AAR1', 'AAR2'
    
    1 回复  |  直到 7 年前
        1
  •  1
  •   luckybilly    7 年前

    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