I would like to create multiplatform Kotlin Native app. I've seen couple of examples, where we have following structure:

  • ...-common (kotlin-platform-common)
  • ...-ios (konan plugin)
  • ...-jvm (kotlin-platform-jvm)

I would like to read some config from file. There are samples that do that in Kotlin Native. Samples use libraries:

  • kotlinx.cinterop.*
  • platform.posix.*

Questions:

  • Is common module - kotlin native module?
  • Can I use this libs in common module?
  • Would they compile to code native to iOS? Or this libs could be used only in platform modules?
up vote 2 down vote accepted

The C interop and the POSIX functions are exclusive to Kotlin/Native and cannot be used in common modules.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.