android-studioresource-cleanup

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?


Solution

  • 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.