Questions tagged [kotlin-native]

Kotlin/Native is a technology for compiling Kotlin to native binaries that run without any VM. It comprises a LLVM-based backend for the Kotlin compiler and a native implementation of the Kotlin runtime library.

361 questions
9
votes
2 answers

Kotlin multiplatform/native interoperability with Objective-C framework

I'm trying to call Swift/Objective-C code from Kotlin in a multiplatform project. There are no problems with calls to platform code. But when I'm trying to call some library (or framework, not sure how it is properly called as I'm not an iOS dev) it…
oleg.semen
  • 2,901
  • 2
  • 28
  • 56
8
votes
1 answer

Is kotlin MPP different than Kotlin Native?

I have read multiple contents online but still not able to understand that is there a clear difference between Kotlin multiplatform mobile vs Kotlin Native?
003
  • 197
  • 1
  • 12
8
votes
1 answer

How to make a multi-module kotlin multiplatform library for iOS?

I'm trying to make a Kotlin Multiplatform library to be used in both Android, JavaScript and iOS. This library is composed of multiple modules so that it can be easily extensible. My problem right now is only with Kotlin native. This is how the…
Benjamin M.
  • 604
  • 6
  • 13
8
votes
1 answer

Read environment variable in Kotlin/Native

OK, so I want to create a native app to read some environment variables, and based on some business logic, change the value of them to something else. I decided to do it in Kotlin. I managed to find out how to change the system environment variable,…
Mattias
  • 161
  • 1
  • 13
8
votes
1 answer

Kotlin native interop linker could not find framework

I'm trying to use cocoapods framework in Kotlin Multiplatform project. So I added framework to Pods file. ran pod install. created .def file added cinterop config in build.gradle ./gradlew cinteropFirebaseIos runs successfully. It generates .klib…
oleg.semen
  • 2,901
  • 2
  • 28
  • 56
7
votes
1 answer

Access C/C++ lib from a multiplatform kotlin project

For the first time, I'm using Android Studio to build a multiplatform project. I have created an Android app module that uses the multiplatform lib on Android. I have also used XCode to build an iOS app that uses the multiplatform lib on…
kingston
  • 11,053
  • 14
  • 62
  • 116
7
votes
2 answers

Is there a web framework for kotlin native

I want to create an app exposing a web server with a REST API in Kotlin Native, but I can't find any recent project or lib. There's kwang but it doesn't seems to be maintained anymore and it depends on another C library.
ThoSil
  • 125
  • 9
7
votes
3 answers

How to execute Kotlin WebAssembly function from JavaScript?

My goal is to write a Kotlin library, compile it to WebAssembly and call its functions from JS. Since a few hours I try to get a simple hello world to work. The documentation on this topic is either non existent or well hidden. This is my kotlin…
7
votes
3 answers

Kotlin-multiplatform: How to execute iOS unit tests

I'm working on a Kotlin-multiplatform library for Android and iOS. I want to write some platform-specific unit test. The tests run as expected for the shared code and Android but not for iOS. Below the build.gradle file of the shared code…
Diego Palomar
  • 6,958
  • 2
  • 31
  • 42
7
votes
2 answers

What is .freeze() in Kotlin/Native?

I see yet another function in Kotlin/Native, that does not exist in the Kotlin JVM or JS. What does it?
Eugene Petrenko
  • 4,874
  • 27
  • 36
7
votes
3 answers

Kotlin native - Execute an executable

I am trying to execute a command via bash, for example konanc. In KotlinJVM this would just be using Runtime.getRuntime().exec("..."), or creating a Process using the ProcessBuilder, however, none of those classes are available in Kotlin-Native, as…
Marcel
  • 1,509
  • 1
  • 17
  • 39
6
votes
1 answer

Kotlin Native (iOS), using CValuesRef with CCCrypt

I am working on an AES256 encryption algorithm in a Kotlin Multiplatform project targeting iOS. I checked some of the existing libraries that implement this in pure Kotlin (such as krypto), but none of them fit the requirements that I have from the…
MrAsterisco
  • 797
  • 8
  • 21
6
votes
1 answer

Polymorphic deserialization with kotlinx.serialization in Kotlin/Native

I want to decode a json string containing a list of objects in a polymorphic class structure using kotlinx.serialization in a Kotlin Multiplatform project, but it works only on JVM, not on Native. Here is a minimum reproducible…
6
votes
3 answers

Pass arguments to Kotlin/native run tasks

I am developing a Kotlin/Native app and I would like to pass arguments to it via Gradle. There are tasks like runDebugExecutableNative. Is there some way to do something like: ./gradlew runDebugExecutableNative --args='myFirstArg mySecondArg'
charlag
  • 1,020
  • 12
  • 20
6
votes
0 answers

How to use CPointer in Kotlin/Native

I cannot find out how to use CPointer in Kotlin/Native; In my iOS source set, I need to build the Kotlin equivalent of the following Object-c code (only including relevant parts of the code): //Object-C copyItemAtPath NSError* error=nil; …
Jevon54
  • 61
  • 2
1
2
3
24 25