9

I just completed my android app. I want to clean up the unused layout files and other resource files such as images and drawables and strings which are not referenced in the actual code. How do I do that? Is there any option to do this in Android Studio?

Samuel Robert
  • 10,106
  • 7
  • 39
  • 60
  • 1
    Does this answer your question? [Remove all unused resources from an android project](https://stackoverflow.com/questions/6373482/remove-all-unused-resources-from-an-android-project) – Richard Le Mesurier Mar 23 '22 at 05:44

2 Answers2

19

You can able to remove unused resources by following way.

  1. Analyze > Inspect Code and find Unused Declarations and Methods.

  2. Android Studio -> Menu -> Refactor -> Remove Unused Resources.

pRaNaY
  • 24,642
  • 24
  • 96
  • 146
0

You can easily search for unused resources from Android Studio. Select res folder -> Just press Ctrl+Alt+Shift+i and type "unused resources" (without quotes). That will execute lint. Super easy way to run lint commands (and other stuff from IDE).

Click on remove all unused resources.

Yamini
  • 732
  • 7
  • 11