简体   繁体   中英

Unable to Initialize DesktopLauncher After Upgrading Android Studio

I upgraded Android Studio from Bumblebee to Chipmunk and now I cannot run the Desktop application, it was working before the upgrade. The Android application still runs fine on my phone, it is only the desktop that is no longer working. I also tried upgrading Gradle, but still the same problem.

I created brand new LibGDX projects using the LibGDX setup application for both version 1.10 (which is what my main app is currently using) and the newer version 1.11, but still the same result. This is the error message I get when running the new test project.

Error: Unable to initialize main class com.tekker.libgdxruntest.DesktopLauncher
Caused by: java.lang.NoClassDefFoundError: com/badlogic/gdx/ApplicationListener

I have tried selecting all of the Java versions and applying them in the Desktop Configuration, but no change. 在此处输入图像描述

It is also selected in the Gradle settings.

在此处输入图像描述

I suspect this is a problem with the Java JDK since the Android application is still working, but I'm not sure what else to try. Thanks.

I got help on the LibGDX Discord by comparing IDE settings.

The fix is to select LibGDXRunTest.desktop.main from the dropdown list instead of just LibGDXRunTest.desktop .

No idea why the .main part was changed after the update. Everything was working fine before this last update so I know this was set correctly before. But it is all working now.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM