Samuel Robert
Samuel Robert

Reputation: 11032

How to clean up unused resource files in Android Studio

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?

Upvotes: 9

Views: 9419

Answers (2)

Yamini
Yamini

Reputation: 792

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.

Upvotes: 1

pRaNaY
pRaNaY

Reputation: 25312

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.

Upvotes: 19

Related Questions