0

I am trying to create a new LibGDX project with the setup GUI they provided but I am getting the following error:


> Configure project :android
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.
Checking the license for package Android SDK Build-Tools 31 in C:\Users\pc\AppData\Local\Android\Sdk\licenses
License for package Android SDK Build-Tools 31 accepted.
Preparing "Install Android SDK Build-Tools 31 (revision: 31.0.0)".

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':android'.
> Failed to notify project evaluation listener.
   > 'void org.apache.commons.compress.archivers.zip.ZipFile.<init>(java.nio.channels.SeekableByteChannel)'

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

I have seen this question but it doesn't appear to help my case. I am only adding the Freetype extension and my supported platforms are Android, Desktop and iOS. NOTE: LibGDX also insists I use a different version of Android Studio as it might be to recent so it chose version 31 for the SDK.

1 Answers1

0

I had this problem. It seems like the LibGDX setup tool can't actually install the Android SDK and build tools so you'll have to do it in Android Studio.

Open the generated project in Android Studio, go into File>Settings>Appearance & Behaviour>Android SDK and install Android API 31 and version 31 of the build tools. After this you can re-sync the project and it should work.