Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"lint" task doesn't include custom rules ("Obsolete custom lint check") #13

Open
ungesehn opened this issue Sep 11, 2018 · 4 comments
Open

Comments

@ungesehn
Copy link
Contributor

ungesehn commented Sep 11, 2018

I updated the current sample for AS3 to override the newly required "getApi()" method in the IssueRegistry.
AAR produced by the ":library" is included locally into dev project.

When running the "lint" task (e.g. lintDebug) on the project it does not include the custom rules:

Obsolete custom lint check
library-release.aar...\lint.jar: Lint found an issue registry (com.example.lint.checks.SampleIssueRegistry) > which requires a newer API level. That means that the custom lint checks are intended for a newer lint > version; please upgrade

IDE support however works fine (highlighting the word "lint" on-the-fly)

Setup:
AS 3.2 RC3 (RC2 with same result)
AGP 3.1.4
Lint 26.3.0-alpha08 (26.2.0-rc02 didn't work either)

@wxgaly
Copy link

wxgaly commented Oct 18, 2018

You can try add this code at subclass of IssueRegistry
@Override public int getApi() { return com.android.tools.lint.detector.api.ApiKt.CURRENT_API; }

@jackleeforce
Copy link

jackleeforce commented Dec 26, 2018

You can try add this code at subclass of IssueRegistry
@Override public int getApi() { return com.android.tools.lint.detector.api.ApiKt.CURRENT_API; }

Anything else code should be added? I have add this code in file SampleIssueRegistry.java,but i got a compile error after do that.

image

image

here is my environment:
image

@btrautmann
Copy link
Contributor

@lijiahua my guess is that you are running a version of AGP in your project that is not compatible with the lint version you are using. Remember, if lint version should be the AGP version but the major version has 23 added to it.

Example: AGP 3.2.1 necessitates lint version 26.2.1

@glorinli
Copy link

@lijiahua my guess is that you are running a version of AGP in your project that is not compatible with the lint version you are using. Remember, if lint version should be the AGP version but the major version has 23 added to it.

Example: AGP 3.2.1 necessitates lint version 26.2.1

This is the correct answer, thank you guy you saved my day!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants