I'm trying to update a JVM app to Kotlin/Native. In order to minimize changes, I want to match the existing code. Can I set an entrypoint that is a main function within an object?
e: Could not find 'main' in 'x.y.z.MyApp' package.
FAILURE: Build failed with an exception.
i
iXPert12
09/05/2023, 11:28 AM
Nope. main function entrypoint is supported on jvm only apps. I would suggest to download and run jetbrains compose multiplatform template, inspect all target entrypoints,and slowly migrate your code there.
h
hfhbd
09/05/2023, 12:38 PM
I don’t think using an object is supported. Kotlin native/c needs a static function and there is no @CNative annotation so “you” need to instance the object first.