4

I have a gradle-based android app. The project structure looks like:

project
  libs
    ActionBarSherlock
      src
      AndroidManifest.xml
    DragSortListView
      src
      AndroidManifest.xml
    PhotoView-1.2.2
      src
      AndroidManifest.xml  
  app
    build
    libs
    src
      main
        assets
        java
        jniLibs
        res
        AndroidManifest.xml
  lint.xml

I'm running Lint on my project as follows:

lint app/src/ --config lint.xml --html app/build/lint/report.html

That's successfully generates lint report, but report contains a batch of warnings

"UnusedResources: Unused resources"
main/res/drawable/my_drawable.xml: The resource R.drawable.my_drawable appears to be unused

Actually Lint marks every resource which I access only via R-file. For instance, if I have a my_layout.xml which I'm using in another xml via @layout/my_layout all be fine. But if I access their only from java code via R-file like R.layout.my_layout lint marks it as "unused"

I tryed to add to Lint input folder with generated R-file from my build-directory, like this

lint app/src/ app/biuld/sources/ --config lint.xml --html app/build/lint/report.html

but this doesn't affect.

Any thoughts and suggestions whats wrong with my lint?

Dmitriy Tarasov
  • 1,949
  • 20
  • 37

0 Answers0