Android Studio:快照依存关系不能正确更新 [英] Android Studio: Snapshot Dependencies Don't Update properly

查看:809
本文介绍了Android Studio:快照依存关系不能正确更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Android Studio 8.9



我有一个build.gradle,定义了以下依赖项:

  compile('my.program.commons:my-program-commons:0.0.2-SNAPSHOT@jar')

这个依赖项存储在一个私有Sonatype连接库中。



当我在my .program.commons代码,我上传到nexus。

问题是,当我然后尝试编译新的SNAPSHOT时,android studio将无法获取更改。



从命令行运行Gradle将成功构建 - 但Android Studio将无法识别新文件。



如果我做了一个版本的刻度 - 从0.0.2-SNAPSHOT到0.0.3-SNAPSHOT说,Android Studio将理解新版本和下载,一切正常。



我不想在每次更改时都做一个小版本的勾选。

解决方案

您需要配置缓存持续时间,默认情况下,gradle不会在24小时内查找更新:



http:// www.gradle.org/docs/current/userguide/dependency_management.html#sec:controlling_caching


I'm working With Android Studio 8.9

I've got a build.gradle with the following dependency defined:

compile ('my.program.commons:my-program-commons:0.0.2-SNAPSHOT@jar')

This dependency is stored in a private Sonatype nexus repository.

When I make changes in the my.program.commons code, I upload to nexus.

The problem is that when I then try to compile against the new SNAPSHOT android studio will fail to pick up changes.

When run from the command line gradle will build succesfully - but Android Studio will not recognize the new files.

If i do a version tick - say from 0.0.2-SNAPSHOT to 0.0.3-SNAPSHOT Android Studio will understand the new version and download and everything works out fine.

I don't want to have to do a minor version tick on every single change.

解决方案

You need to configure the cache duration, by default gradle won't look for updates for 24 hours:

http://www.gradle.org/docs/current/userguide/dependency_management.html#sec:controlling_caching

这篇关于Android Studio:快照依存关系不能正确更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆