[Fix] cvc-complex-type.2.4.a Invalid content was found starting with element ‘base-extension’. One of ‘{layoutlib}’ is expected

I was recently trying to use the new android studio (bumble bee) to download a project from GitHub, when I got an unexpected error; ” cvc-complex-type.2.4.a: Invalid content was found starting with element ‘base-extension’. One of ‘{layoutlib}’ is expected “. A snippet of the error is given below:

cvc-complex-type.2.4.a: Invalid content was found starting with element 'base-extension'. One of '{layoutlib}' is expected

I would like to share the steps that helped me to fix the error; cvc-complex-type.2.4.a: Invalid content was found starting with element ‘base-extension’. One of ‘{layoutlib}’ is expected.

Why cvc-complex-type.2.4.a Invalid content was found starting with element ‘base-extension’. One of ‘{layoutlib}’ is expected is seen?

The error, ‘ cvc-complex-type.2.4.a: Invalid content was found starting with element ‘base-extension’. One of ‘{layoutlib}’ is expected ‘ is seen because the version of Gradle build being used by the android studio is an old and outdated one, with all different kinds of maladjustment.

This is also a problem with the latest version of the android studio bumble bee. The latest version of Bumble bee does not support the older version of the Gradle build due to many different maladjustment and errors.

A detailed solution to fix the cvc-complex-type.2.4.a: Invalid content was found starting with element ‘base-extension’. One of ‘{layoutlib}’ error is provided below:

How to fix cvc-complex-type.2.4.a Invalid content was found starting with element ‘base-extension’. One of ‘{layoutlib}’ error?

A simple solution to fix this would be to change the Gradle JDK setting from the android studio settings. Some short steps would be to go to File > Project Structure > SDK Location > Gradle Settings.

To resolve the error cvc-complex-type.2.4.a: Invalid content was found starting with element ‘base-extension’. One of ‘{layoutlib}’, You will have to change the Gradle setting from the settings part of your android studio.

Follow the steps given below to fix the error:

Step 1: Go to the file section in your android studio settings.

Step 2: Go to the project structure in the file section.

Step 3: Go to the SDK Location section in the project structure section.

Step 4: Go to Gradle settings and change your Gradle Plugin Version to Gradle Plugin Version7.0.3 And Gradle Version 7.0.2.

Setting section of the android studio

Conclusion

To fix the cvc-complex-type.2.4.a: Invalid content was found starting with element ‘base-extension’. One of ‘{layoutlib}’ errors; try updating your Gradle version by going into the settings of your android studio. A simple and short fix would be following the steps; File > Project Structure > SDK Location > Gradle Settings.