6

We have a large (somewhat unwieldy) project, that definitely has files, both Java classes and XML files (and probably images as well), that are no longer used. Is there a tool or a way to find out which files are not referenced in the project?

I saw this question, but it's not Android specific: Find unused classes in a Java Eclipse project

Community
  • 1
  • 1
StackOverflowed
  • 5,854
  • 9
  • 55
  • 119

3 Answers3

4

In eclipse, you can actually use the Android Lint tool. Click on Window, then "Run Lint Tool". It will find all of the problems in your code it thinks should be corrected. One of the problems it finds "The resource R.id.xxx appears to be unused" and will highlight as a warning all files that it believes are not used in your project. So far I've found it to be pretty accurate.

ajacian81
  • 7,419
  • 9
  • 51
  • 64
3

I use, and like Classpath Helper:

http://classpathhelper.sourceforge.net/

This works with Android projects inside of Eclipse.

Josh
  • 12,448
  • 10
  • 74
  • 118
0

below link is the best way, enjoy it!

android-unused-resources

  • 2
    Note that [link-only answers are discouraged](http://meta.stackoverflow.com/tags/link-only-answers/info), SO answers should be the end-point of a search for a solution (vs. yet another stopover of references, which tend to get stale over time). Please consider adding a stand-alone synopsis here, keeping the link as a reference. – kleopatra Jan 21 '14 at 09:32
  • the link is the end-point solution, you can download and use that jar file and use the document of that for solving the problem. – Masoud Kardani Jan 22 '14 at 12:09