简体   繁体   中英

Libgdx lwjgl3 crash on start

I switched on lwjgl3 from lwjgl2 and can't run game with that.

Full code:

Lwjgl3ApplicationConfiguration config = new Lwjgl3ApplicationConfiguration();
config.setWindowedMode(1280, 720);
new Lwjgl3Application(new MyGdxGame(), config);

Crash log: https://pastebin.com/0N1tAYRk

GLFW windows may only be created on the main thread and that thread must be the first thread in the process.

Run the JVM with -XstartOnFirstThread

If you're using IntellijIDEA/Android Studio

Go to Run -> Edit Configuration -> Click to your desktop config ->Configuration Tab -> VM Options -> Paste -XstartOnFirstThread -> Click apply -> Ok and then run.

There was the same problem with android studio 4.2.1, it helped me in the build.gradle file, in the "dependencies" block, change:

"com.PROJECT_NAME.gdx:gdx-backend-lwjgl:$gdxVersion" 

to

"com.PROJECT_NAME.gdx:gdx-backend-lwjgl3:$gdxVersion"

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