简体   繁体   中英

Can't open a second instance of LibGDX game?

I'm currently developing a small multiplayer game for a university project using LibGDX in IntelliJ, but I'm running into an issue where I can't run more than one game at a time to test multiplayer functionality.

On executing the program the first time everything runs okay, but the second time I click run the process shows as running yet won't open a window until the first instance is closed. I've gone into the build/run configurations and checked the "Allow parallel run" option, but it didn't seem to do anything. Any idea what could be causing this?

The problem is that your application is executed as a Gradle Run Task . The task will wait for the exit code of the process and block all other tasks including run tasks. I don't know if parallel execution of run tasks is possible, but this workaround worked for me:

  1. Swap the Build and run option from Gradle to native IntelliJ IDEA as described here
  2. Now reconfigure your run configuration. If you are using Kotin you need to create a new one

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