How to Completely Remove an Android Layout from Android Studio

I'm building an app in Android Studio and I accidentally created a base LoginActivity template but then deleted it because I wanted to make my own. Now, when I try creating another activity with the same name, it tells me "Layout name must be unique."

I could just name it something else but:

  1. I don't want to
  2. There would still be some sort of duplicate files in my system doing nothing

My goal is to just remove all mentions of activity_login, ultimately so I can make a new activity with the same name, but I can't figure out how.


Solution 1:

Go to res->layout->activity_login.xml and delete it from android studio

Or open project in file explorer, then Go to app/src/main/res/layout/activity_login.xml and delete it

If it didn't solve it, Invalidate Caches and restart Android Studio.