Well, I guess there is a plethora of circumstances that can trigger this issue. I'm using IntelliJ Idea instead, but it's mostly the same than Android Studio. My solution for this problem:
Fastest way:
Right click on the class file that contains the main activity of your project, and then on "Debug 'WhateverActivity'". This will create a new run configuration that should debug fine.
Other solution, without creating a new run configuration:
- Open Run/Debug configurations and within "Android app" pick the configuration you're using to debug your app.
- Locate "Launch Options/Launch" there and set it to "Specified Activity" instead of "Default Activity".
- In the "Launch" field just below the aforementioned option, click on the three ellipsis (three dots) button and select your main activity.
At least it worked for me. I hope it works for others too.