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?
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.)
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.
In Android Studio 2.0 and above
in menu select Refactor-->click on Remove Unused Resources...
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;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With