Remove all unused classes,methods from Android Studio project

This can be achieved by using the built-in inspection Java | Declaration redundancy | Unused declaration.

To run it on whole project go to Code -> Analyze -> Run inspection by name..., type Unused declaration and select desired scope.
Then carefully check output and mark some classes as entry points if needed.

Now you can select Unused declaration node in list and perform Safe delete action on all unused declarations at once.

Inspection result

For Kotlin there is similar inspection Kotlin | Redundant constructs | Unused symbol.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)