My project has a large number of String and ImageResources, many of which i feel are unused. Is there any way i can find out which of these resources are currently not been referenced from my code?
9 Answers
In Android Studio (tried up to Version 2.1.3), you can simply go to Main Menu -> Analyze -> Run Inspection by Name..., and select Unused resources
(It runs Android Lint for you.)

- 5,561
- 5
- 50
- 65
-
2How to delete all resources? – Rajat Mehra Jul 07 '16 at 08:46
In Android Studio there is a shortcut available.
Press Ctlr + Alt + Shift + i (or Cmd + Option + Shift + i on Mac)
This will open a dialog in which you can type "Unused" to see a number of options.
I generally type "unused resources" and get a list including layouts, strings, drawables, etc.

- 2,297
- 24
- 24

- 1,090
- 12
- 12
In Android Studio 2.0 and above
in menu select Refactor-->click on Remove Unused Resources...

- 7,009
- 4
- 25
- 38
Improving @Ramesh R answer, the best way is Right click on your res folder, Select Refactor and Remove Unused Resources.
This tool is fantastic, my applauses to his developer xD;

- 470
- 6
- 12
you can use lint
Android Lint is a new tool for ADT 16 (and Tools 16) which scans Android project sources for potential bugs.
Here are some examples of the types of errors that it looks for:
Missing translations (and unused translations)
Layout performance problems (all the issues the old layoutopt tool used to find, and more)
Unused resources
Inconsistent array sizes (when arrays are defined in multiple configurations)
Accessibility and internationalization problems (hardcoded strings, missing contentDescription, etc)
Icon problems (like missing densities, duplicate icons, wrong sizes, etc)
Usability problems (like not specifying an input type on a text field)
Manifest errors and many more.

- 21,409
- 40
- 127
- 196
You can use this library
Place it to project folder and run jar from command line.

- 3,470
- 4
- 44
- 84

- 5,443
- 1
- 29
- 36
-
This jar program finds resources that lint overlooks, such as in colors, dimensions etc... – Guy Jan 09 '14 at 10:27
If you want to delete unused resources in drawable file : Click on drawable file ~ then Click Refactor ~ then Click Remove Unused Resources..

- 11
- 3
Regarding the image resources you would like to remove, you should also consider moving all the drawable-xxxx folders out of your project into a temporary folder, then do a rebuild all, and take a look at the build message list which will tell you which ones are missing.
This can be specially useful if you want to get an overview of which resources you are effectively using and maybe replace them with an icon font or svg resources, possibly with the help of the Android Iconics library.

- 13,684
- 11
- 87
- 116