LibGDX安装程序为Android Studio抛出异常



我正试图用他们提供的设置GUI创建一个新的LibGDX项目,但我收到了以下错误:


> 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:UserspcAppDataLocalAndroidSdklicenses
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.

我看过这个问题,但似乎对我的案子没有帮助。我只添加了Freetype扩展,我支持的平台是Android、Desktop和iOS。注意:LibGDX还坚持我使用不同版本的Android Studio,因为它可能是最近的版本,所以它选择了版本31作为SDK。

我遇到了这个问题。看起来LibGDX安装工具实际上无法安装Android SDK和构建工具,所以你必须在Android Studio中安装。

在Android Studio中打开生成的项目,进入文件>设置>外观&行为>安卓SDK并安装安卓API 31和版本31的构建工具。在此之后,您可以重新同步项目,它应该可以工作。

最新更新