Is it even possible? It seems every third-party tool that did it is abandoning the feature and I can’t get the deprecated but still present feature to work in Detekt or ktlint. I didn’t realise the biggest challenge with Kotlin would be detecting unused import statements so I can easily remove them.
Edit: Thanks for the help everyone, but I could not get anything working so I eventually just did it manually with a little help from the android linter.


My bad, I think the option I mentioned might have existed at some point but doesn’t now.
Sadly it’s probably a moating strategy for jetbrains to have that as an IDE exclusive feature.
The best you can probably do is trying to dig out that functionality from the android studio source … https://android.googlesource.com/platform/tools/base/+/studio-master-dev/studio.md