This specific issue happens when the Project SDK and the Dependencies on the Module SDK are not pointing to correct Android API Platform
xxxxxxxxxx
In your Android Studio
-Go to File > Project Structure
-In the window that will pops up
-Select Project Settings/Project
-Make sure Project SDK is set to the latest platform version.
At the time of posting this it is:
Android API 30 Platform version 11.0.10
-After selecting the right version, click Modules and on Module SDK make sure it is set to
Android API 30 Platform version 11.0.10
and click Apply
xxxxxxxxxx
// set in project structure
// in project tab, set sdk to any sdk you have
// In the modules tab, go to the dependencies tab and set the sdk module according to the same sdk that you set in the project tab.