For me resyncing the project with Gradle files helped. I didn't modify anything, because the code worked before I shut down the system. I am using the latest Android Studio (Meerkat | 2024.3.1 Patch 2), but it is still an issue.