Hi all, I'm new to Kotlin. Do you know is it possi...
# getting-started
a
Hi all, I'm new to Kotlin. Do you know is it possible to create cross-platform library that uses some shared library, e.g.
.so
in kotlin for Android and iOS?
c
iOS doesn't use the
.so
format (more information), this is unrelated to Kotlin. Regarding Kotlin: yes, you can create a project which uses native libraries, using Kotlin/Native (#kotlin-native). Note that is considered "single platform" in Kotlin-speak ("multiplatform" would mean using Kotlin/Android on Android, running on ART, and Kotlin/Native on iOS).
The linked SO answer seems to say dynamic libraries are forbidden by the App Store, but I don't know enough to confirm or deny.
a
Thanks a lot, I've access to the source I that library, so I should cross-compile the library once for android and once for iOS and the use kotlin-native to use that library on each platform, am I right?
c
Yes. You can read more here, and ask your questions in #kotlin-native.
🙏 1
l
On iOS, the library should create a dylib. You can use kotlin's cinterop to call into it.