Android Studio:快照依赖项未正确更新 [英] Android Studio: Snapshot Dependencies Don't Update properly

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

问题描述

我正在使用 Android Studio 8.9

I'm working With Android Studio 8.9

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

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

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

此依赖项存储在私有的 Sonatype nexus 存储库中.

This dependency is stored in a private Sonatype nexus repository.

当我对 my.program.commons 代码进行更改时,我会上传到 nexus.

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

问题是,当我尝试针对新的 SNAPSHOT android studio 进行编译时,将无法获取更改.

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

当从命令行运行时,gradle 将成功构建 - 但 Android Studio 将无法识别新文件.

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

如果我做一个版本勾号——比如从 0.0.2-SNAPSHOT 到 0.0.3-SNAPSHOT,Android Studio 会理解新版本并下载,一切正常.

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.

推荐答案

你需要配置缓存时长,默认情况下 gradle 不会在 24 小时内寻找更新:

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天全站免登陆