Search code examples
javaandroidkotlingradlesdk

How I can resolve "This version only understands SDK XML versions up to 2 but an SDK XML file of version 3 was encountered"?


I am getting this error "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."

My app still working but this error is annoying.

Can anyone help?


Solution

  • The most common reason for this error can be the usages of outdated Android SDK tools that are unable to understand the most recent "SDK XML" files.

    You should update your SDK tools to the most recent version that supports the "SDK XML", Version 3 should solve the problem.

    This is a possible procedures to upgrade your SDK tools:

    1. Open Android Studio.
    2. Go to File->Settings->Appearance & Behaviour->System Settings->Android SDK.
    3. Open SDK Manager and select SDK Tools.
    4. Check the Android SDK Built-Tools.
    5. If it's not updated, select the latest version and click Apply to install it.
    6. When the installation is completed, restart Android Studio.
    7. Try to rebuild your Application.

    You can also try Invalidate Caches and to clone the project again.

    Also check this Update the IDE and SDK tools and this sdk - How to update Android Studio automatically?