问题
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