棉绒:“可用较新的库版本”使用变量时 [英] Lint: "Newer Library Versions Available" when using variables

查看:123
本文介绍了棉绒:“可用较新的库版本”使用变量时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含3个子项目的项目。我希望3个子项目使用相同的依赖项版本,因此我将所有版本都放在了根 build.gradle 中:

  allprojects {
ext.versions = [
supportLibVersion:'26 .1.0',
playServicesVersion:'11 .2.2',
retrofitVersion:'2.1.0',
retrofitConverterGsonVersion:'2.1.0',
retrofitRxjava2AdapterVersion:'1.0.0',
rxjava2Version:'2.0.5',
rxandroidVersion: 2.0.1,
timberVersion: 4.5.1,
...
]
}

现在,lint不再突出显示可用的新库。



有什么机会我可以再次使用它吗?

解决方案

这不是该问题的确切答案。不久前,我也有同样的担忧(声明了全局变量,并从 build.gradle 文件中引用了它们)。



我找到了


I have a project with 3 sub-projects. I want the 3 sub-projects to use the same dependencies versions so I factored all the versions in the root build.gradle:

allprojects {
ext.versions = [
        supportLibVersion: '26.1.0',
        playServicesVersion: '11.2.2',
        retrofitVersion: '2.1.0',
        retrofitConverterGsonVersion: '2.1.0',
        retrofitRxjava2AdapterVersion: '1.0.0',
        rxjava2Version: '2.0.5',
        rxandroidVersion: '2.0.1',
        timberVersion: '4.5.1',
        ...
]
}

Now lint doesn't highlight new libraries available anymore. It somehow still works for the supportLibs but not for the other ones.

Any chance I can have this working again?

解决方案

This is not an exact answer to the question. I had the same concerns some time ago (had declared global vars and referred to them from build.gradle files).

I've found gradle-versions-plugin library, which resolved my concerns.

It will prompt with detailed info after ./gradlew dependencyUpdates

这篇关于棉绒:“可用较新的库版本”使用变量时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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