After I update the target Android SDK from 30.0.3 to 31.0.0 I started to have these 2 warnings :
This version only understands SDK XML versions up to 2 but an SDK XML file of version 3 was encountered. This can happen if you use versions of Android Studio and the command-line tools that were released at different times.
Warning: unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level>
I tried to update all the libraries but it didn't help. Anyone had this warning ?
I had these same errors, to resolve this error, I created new project and ran this new project, i don't found same error. I resolved my problem just comparing the two codes and changing the old one codes the old project
This is caused by using a newer version of commandline-tools to download the packages of Android SDK, while your project is probably using an older version of Gradle.
Enter your Android SDK directory and delete everything but the licenses folder. Try to rebuild your project and Gradle will redownload all the tools needed. This time the warning won't be logged.