I have a Multiplatform app with desktop(compose), ...
# compose-desktop
z
I have a Multiplatform app with desktop(compose), Android app and web. When I run the desktop module in windows directly from Idea (Play Button), then the JVM application opens. But, if I run
:packageMsi
, install
.msi
and try to run the
.exe
file, then it is not opening. It doesn't even throw any error. How to fix this and how to check logs of an executive application?
v
Does it print anything when opening the .exe from CMD or Powershell?
z
Nope. I tried
FILE.exe > output.txt
as well And the txt file came out blank
v
maybe something with the packageMSI that needs additional config? Maybe it isn't finding your main class
haven't used that in a while
m
Did you try the gradle targets runDistributable or runReleaseDistributable? This might provide some more insight into what’s going wrong.
z
It's unable to find my class Main.kt
But, we don't have class right? We just have a main() function. How do I fix this? In Gradle, i correctly pointed out to the Main.kt file
v
Kotlin automatically creates a class to hold your
main()
based on the file name. If you have your
main()
in
Main.Kt
kotlin will generate a
MainKt
class for the JVM
m
Copy code
mainClass = "MainKt"
Note the “Kt” in the name.
z
ah. Just found out the same. It was "Main.kt" earlier (I guess intellij project template has written it like that). And I tried changing it to Mainkt. But overlooked the capital K Thanks everyone. It's fixed now.
m
Apps just not appearing if the JVM fails to start or if an exception escapes the main thread is an annoying issue. If you use Conveyor instead of the packageMSI task, that is resolved and an error dialog with the exception message and top stack frame will appear, you can also put apps into console mode easily.
298 Views