1

I've been cleaning up Lint warnings on my Android project, but some of them seem to persist even after I've fixed them.

For example, I got this warning:

Use android.util.FloatMath#sqrt() instead of java.lang.Math#sqrt to avoid argument float to double conversion

Hey, good to know. I learned something. So I correct the error (and I tried both converting my math to use double and changing Math for FloatMath) and rerun my Lint report. The warning still appears! What's more, the little code snip that appears in the HTML report is of the same line as before, but since I moved some code around, what's displayed is no longer relevant. So it seems like Lint is caching the results of the previous runs somehow, but I haven't figured out how to clear that out.

I'm using command-line Lint and generating an HTML report from the results, if that's relevant. I'm using the following command, which outputs a multi-file HTML report in the lint_report directory and scans the Android project in project_directory.

$ lint --html lint_report/ project_directory/

Can I clear out old results for Android Lint somehow, or is this a bug?

Bananeweizen
  • 21,797
  • 8
  • 68
  • 88
Argyle
  • 3,324
  • 25
  • 44

2 Answers2

2

It turns out that Android Lint uses the compiled class files to do its reporting. The answer is simply to rebuild the app before running the Lint report.

Argyle
  • 3,324
  • 25
  • 44
1

In Eclipse:

First

Right click on project > Android Tools > Clear Lint Markers

Then

Right click on project > Android Tools > Run Lint: Check for Common Errors

Command Line: (Following the example above)

First

rm -rf ./project_directory/lint_report

Then

Run Lint again

HandlerExploit
  • 8,131
  • 4
  • 31
  • 50
  • This would be helpful if I were running Eclipse! My IDE is IntelliJ IDEA and in any case, I'm running my report from the command line. I've edited my question to make this fact more obvious. – Argyle Apr 13 '12 at 20:13
  • Tried that, and it didn't work. I even put the report in a freshly created directory that didn't exist before. The timestamps at the top of the reports always got updated, and it's not like a JUnit report where zillions of little XML files get aggregated. It's just one file per project. – Argyle Apr 13 '12 at 20:28