There is a problem with version 31.0.0. You can choose another version
first go to tools – & gt; Uninstall 31.0.0 in SDK manager, Download Android R (API 30: version 11)
after that, modify the three variables compilesdkversion, buildtoolsversion and targetsdkversion in APP/build.gradle file
compileSdkVersion 30
buildToolsVersion “30.0.0”
targetSdkVersion 30