I have created a libGDX project in Android Studio. When I first created the project, I only selected the "Android" subproject.

Now, I have changed my mind and want to add a desktop platform module to my libGDX project in order to run the "Tools" extension. There doesn't seem to be another question asking this on stackoverflow, and that is why I am asking it. How can I achieve this?
You know Project Name and package of your already generated libgdx project.
Generate another project with above details at some other place then copy the desktop folder in your old project.
Now you've to add that module in your project.
settings.gradle filebuild.gradle fileDone, Sync your project dependency.
EDIT
Content inside settings.gradle file should be like this :
include 'android', 'core', 'desktop'
Add below code in your project level build.gradle file
project(":desktop") {
apply plugin: "java"
dependencies {
implementation project(":core")
implementation "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
implementation "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With