https://kotlinlang.org logo
Title
g

Giorgi

05/07/2023, 7:00 PM
m

Michael Paus

05/07/2023, 7:54 PM
Why don’t you start with one of the examples which support macOS, like, e.g., https://github.com/JetBrains/compose-multiplatform/tree/master/examples/falling-balls
n

Nikita Lipsky

05/08/2023, 1:32 PM
macosX64 native target is too experimental, but yes please try mentioned sample above first and then check what are differences in the configuration (gradle scripts, etc.) with your project
g

Giorgi

05/10/2023, 10:56 AM
thanks for the reply. I tried to run the sample from shared -> macosMain via green button, but it has same results. There is a message BUILD SUCCESSFUL and thats it.
I though I was missing
NSApplication.sharedApplication()
on my app, but it also does not help to show the window
m

Michael Paus

05/10/2023, 1:11 PM
g

Giorgi

05/10/2023, 1:30 PM
Did you select the proper run configuration as described here?
what does shared[macosX64] mean? I though it was a gradle task or part of gradle task name but I dont have any.
Also, did you set up your environment as described here?
yea, I missed this. Added couple UTF-8 env variables and it says that my system is ready for Kotlin multiplatform
before I was trying to run with
runDebugExecutableMacosArm64
, but still does not work...
wait, I dont have Arm64, Im on Intel i7, it should be X64, right?
okay so I got it to work. I ran
runDebugExecutableMacosX64
it failed saying there is no main in root package, then I added a new directory in shared module
macosX64
with copied main function from macosMain, ran
runDebugExecutableMacosX64
and the window showed up
and now how I know what is missing from my project...
why ``runDebugExecutableMacosArm64` does not fail when I ran it on X64?
m

Michael Paus

05/10/2023, 6:46 PM
I am glad you got it working. I experienced the same problem in the end. I think JetBrains project setup is simply not correct. Maybe you want to report that as a bug.