【问题标题】:how force download aar version of dependencies in gradle如何在gradle中强制下载依赖项的aar版本
【发布时间】:2019-09-04 13:22:37
【问题描述】:

最近我将glide4.8.0升级到4.9.0

如您所见,在最新版本中添加了一些额外的依赖项: https://search.maven.org/artifact/com.github.bumptech.glide/glide/4.9.0/aar

它添加了vectordrawable-animated 27.1.1

    <dependency>
      <groupId>com.android.support</groupId>
      <artifactId>animated-vector-drawable</artifactId>
      <version>27.1.1</version>
      <scope>compile</scope>
    </dependency>

我在我的项目中也使用了androidX,当我想同步gradle时,出现了这个错误:

':app': Unable to build Kotlin project configuration
Details: org.gradle.internal.resolve.ArtifactNotFoundException: 
Could not find vectordrawable-animated.jar (androidx.vectordrawable:vectordrawable-animated:1.0.0).
Searched in the following locations:
https://maven.google.com/androidx/vectordrawable/vectordrawable-animated/1.0.0/vectordrawable-animated-1.0.0.jar

如您所见,它使用此链接下载此依赖项:

https://maven.google.com/androidx/vectordrawable/vectordrawable-animated/1.0.0/vectordrawable-animated-1.0.0.jar

但没有找到!

但如果您将.jar 更改为.aar,它就可以下载了。

https://maven.google.com/androidx/vectordrawable/vectordrawable-animated/1.0.0/vectordrawable-animated-1.0.0.aar

如何强制使用aar版本而不升级其他东西?

【问题讨论】:

    标签: android gradle dependency-management androidx android-glide


    【解决方案1】:

    如果您只想下载忽略传递依赖关系的 aar 工件,请使用 @aar 表示法。

    implementation "androidx.vectordrawable:vectordrawable-animated:1.0.0@aar"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-11-13
      • 2020-08-10
      • 2016-07-28
      • 2019-12-29
      • 1970-01-01
      • 1970-01-01
      • 2014-03-15
      • 2020-02-11
      相关资源
      最近更新 更多