首页 文章

Maven AAR传递依赖 - >错误

提问于
浏览
0

我有一个问题是从已部署的工件库中检索AAR传递依赖项 .

这里 build.gradle

dependencies {
  implementation "x.y.z:B:1.0.0"
}

x.y.x:B:1.0.0POM file 中,我有这样的配置:

<dependency>
  <groupId>x.y.z</groupId>
  <artifactId>A</artifactId>
  <version>1.0.0</version>
  <type>aar</type>
  <optional>false</optional>
</dependency>

但是Gradle有一个错误,因为它搜索.jar文件而不是.aar文件 . 我错过了一步吗?

Could not resolve all files for configuration ':sample:debugAndroidTestRuntimeClasspath'.
> Could not find A.jar (x.y.z:A:1.0.0).
  Searched in the following locations:
      http://.../x/y/z/A/1.2.5/A-1.0.0.jar

此外,库A在Maven上只包含.aar和.pom文件 .

信息:所有这些库都属于同一个私有maven神器 .

1 回答

  • 0

    我找到了解决方案 . 如果您遇到同样的问题,解决方法如下 .

    我想念在pom文件中的库中添加这一行 .

    <packaging>aar</packaging>
    

相关问题