首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在gradle中强制下载依赖项的aar版本

如何在gradle中强制下载依赖项的aar版本
EN

Stack Overflow用户
提问于 2019-09-04 13:22:37
回答 1查看 653关注 0票数 1

最近,我将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

代码语言:javascript
复制
    <dependency>
      <groupId>com.android.support</groupId>
      <artifactId>animated-vector-drawable</artifactId>
      <version>27.1.1</version>
      <scope>compile</scope>
    </dependency>

我在我的项目中也使用了androidX,当我想同步gradle时,发生了以下错误:

代码语言:javascript
复制
':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版本而不升级其他东西?

EN

回答 1

Stack Overflow用户

发布于 2019-09-04 19:52:56

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

代码语言:javascript
复制
implementation "androidx.vectordrawable:vectordrawable-animated:1.0.0@aar"
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57789356

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档