Go to core project and the desktop project, right click and select Configure, then add Scala nature
You should now have in the build path
“Scala Library Container”
you need a Scala nature on both projects for adding Scala code to the core as well as running the program via desktop project. That said all logic should sit in core project if you are to run the final app on android and desktop.
find the SimpleGame.java class in the core project and delete it.
Create a new SimpleGame.scala class instead in the same package, with the following code
to enable scala when building from command line add
apply plugin: “scala”
./gradlew clean desktop:run
./gradlew clean android:installDebug android:run