For me the issue was a typo in the folder name.
In order for android studio to recognize a folder as a module, that folder must be included in the `settings.gradle.kts` at the root level. If either the folder or the include have a typo, then Android Studio will fail to recognize the module as such, and trying to run it will result in the aforementioned error.
**Faulty sample:**
* Folder name: "desktop"
* Include statement: `include(":dekstop") `
**Fix:**
* Folder name: "desktop"
* Include statement: `include(":desktop")`