I'm following the official tutorial to create a de...
# multiplatform
a
I'm following the official tutorial to create a desktop app: https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-multiplatform-create-first-app.html#run-your-application-on-desktop But when I try to build/run, I get the error:
Could not find or load main class MainKt
.Please help.
z
Ah, this is because the wizard changed to now put the code in the package specified on the website instead of the root package. If you used the default settings in the wizard, this should work:
Copy code
desktopRun -DmainClass=com.jetbrains.demo.MainKt --quiet
❤️ 2
An even easier way is to use the gutter icon next to the
main
function to start the application:
🙌🏽 1
Just realized there's a simpler way than specifying the
mainClass
, you can just run the
:composeApp:run
Gradle task on its own and that should work as well.
a
Thank you @zsmb! You saved my day!
😄 2