Add Warning “A newer version of … is available” for custom library

浪子不回头ぞ 提交于 2019-12-08 01:57:27

问题


I've just released my library with version 1.2.1, code is in Github

As you can see in the picture:

I'm getting "Warning" that i'm using old version of appcompat library but there's no warning for my library.

I've distribute my library via Bintray to maven & jcenter.

Does anyone knows how to enable this Note/Warning on my library line?


回答1:


The problem is that regardless of which repository your library is resolved from (being it jcenter(), mavenCentral() or any other repository), the check for the latest version is hardcoded to go to Maven Central.

That's plain wrong, if you ask me, but it is what it is at the moment (we'll work on reporting it as a bug and submitting a pull request). Until it is changed, the only way to guarantee your library will be correctly reported by this intention is to publish your library to Maven Central. Good news are that if your library is already in JCenter, it's very easy to sync it to Maven Central as well.




回答2:


As Sneh Pandya pointed out. This is a setting you can enable.

In Android studio 2.3.1 you can enable this if you go to File --> Settings --> Editor --> Inspections. You can than search for library and enable the "Newer Library Version Available "lint-check. This will check for for newer versions of any MavenCentral dependencies. This will however slow down your builds.



来源:https://stackoverflow.com/questions/43660367/add-warning-a-newer-version-of-is-available-for-custom-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!