【问题标题】:Gradle: .aar library not included into compiler's outputGradle:.aar 库未包含在编译器的输出中
【发布时间】:2014-09-11 09:43:53
【问题描述】:

我有一个 Gradle 项目,由两个子项目组成:UI 和后端库。 它自己的库依赖于另一个 .aar 库。

从库的 build.gradle 中提取:

dependencies {
    compile(name: 'ActionBarSherlock', ext: 'aar')
}

从 UI 的 build.gradle 中提取:

dependencies {
    compile project(":my_library")
    compile fileTree(dir: 'libs', include: ['*.jar']) // all jars
}

当我尝试构建项目时,构建失败并出现以下错误:

> Could not resolve all dependencies for configuration ':UI:_debugCompile'.
   > Could not find :ActionBarSherlock:.
     Required by:
         Project:UI:unspecified > Project:my_library:unspecified

我检查了my_library 的.aar 输出,它在libs 文件夹中不包含ActionBarSherlock.arr。如何告诉 Gradle 将 .arr 文件包含到库输出中?

【问题讨论】:

    标签: android groovy gradle android-gradle-plugin


    【解决方案1】:
    transitive = true
    

    似乎不见了。例如(在 build.gradle UI 中):

    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile ('com.your.company.backendlib') {
            transitive = true
        }
    }
    

    【讨论】:

      猜你喜欢
      • 2015-02-24
      • 1970-01-01
      • 2016-07-28
      • 2018-01-17
      • 2015-04-01
      • 1970-01-01
      • 2013-01-12
      • 2016-12-21
      • 1970-01-01
      相关资源
      最近更新 更多