Android Studio处理SNAPSHOT依赖项

Spo*_*ght 7 android gradle maven android-studio android-gradle-plugin

通过在Android Studio 3.0.1上使用SNAPSHOT依赖项,我遇到了一些麻烦.我也试过Android Studio 3.1,同样的问题依然存在.

我通过以下方式包含依赖项:

dependencies {
    configurations.all {
        resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
        resolutionStrategy.cacheDynamicVersionsFor 0, 'seconds'
    }
    implementation('com.example:lib:0.0.1-SNAPSHOT') { changing = true }
}
Run Code Online (Sandbox Code Playgroud)

发布新版本的库时,如果单击"刷新所有Gradle项目"图标,则应用程序构建正常.但是,Android Studio在快照中看不到任何更改.

我已经尝试重启Android Studio并使其缓存无效,没有任何区别.

如何让Android Studio了解这些变化?

Fco*_* P. 4

我也有同样的问题。到目前为止,对我有用的是通过命令行刷新依赖项:

./gradlew clean --refresh-dependencies
Run Code Online (Sandbox Code Playgroud)

之后,完全退出AS并再次打开它。如果我发现其他内容,我会更新我的答案。