https://kotlinlang.org logo
Docs
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
kotlin-native
  • d

    Denis Shurygin

    10/30/2018, 3:17 PM
    Does it possible to build a Kotlin/Native library for all targets at once as a single ".klib" file?
    o
    1 reply · 2 participants
  • j

    jaguililla

    10/30/2018, 6:51 PM
    Hello everyone... Do someone knows an UI framework (like QT) easy to integrate with Kotlin native?
    n
    2 replies · 2 participants
  • j

    jaguililla

    10/30/2018, 7:05 PM
    I just saw a GTK example 😬 sorry
    n
    2 replies · 2 participants
  • t

    tapchicoma

    10/30/2018, 8:00 PM
    java.lang.NoSuchMethodError: org.jetbrains.kotlin.konan.target.HostManager.<init>(Lorg/jetbrains/kotlin/konan/target/SubTargetProvider;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
            at org.jetbrains.kotlin.gradle.plugin.mpp.KotlinMultiplatformPlugin.setupDefaultPresets(KotlinMultiplatformPlugin.kt:149)
            at org.jetbrains.kotlin.gradle.plugin.mpp.KotlinMultiplatformPlugin.apply(KotlinMultiplatformPlugin.kt:81)
            at org.jetbrains.kotlin.gradle.plugin.mpp.KotlinMultiplatformPlugin.apply(KotlinMultiplatformPlugin.kt:38)
            at org.jetbrains.kotlin.gradle.plugin.KotlinBasePluginWrapper.apply(KotlinPluginWrapper.kt:77)
            at org.jetbrains.kotlin.gradle.plugin.KotlinBasePluginWrapper.apply(KotlinPluginWrapper.kt:39)
            at org.gradle.api.internal.plugins.ImperativeOnlyPluginTarget.applyImperative(ImperativeOnlyPluginTarget.java:42)
    Does somebody know how to fix such exception, when using new MPP plugin and adding native "linuxX64" target on linux host?
    o
    i
    11 replies · 3 participants
  • j

    jkbbwr

    10/30/2018, 10:18 PM
    How can one enable kotlin coroutines in all the glory with the mpp plugin
    👍 1
    o
    7 replies · 2 participants
  • g

    groostav

    10/30/2018, 10:38 PM
    I'm looking to replace a couple of chunk of native code with kotlin native, and am wondering if I get any wins on my current mess of
    dllexport
    and
    extern "C"
    and
    Native.loadLibrary
    business
    j
    1 reply · 2 participants
  • o

    orangy

    10/30/2018, 10:40 PM
    there is no documented interop between K/N and K/JVM other than standard JVM tools, like JNI
    😢 2
    d
    o
    3 replies · 3 participants
  • n

    Nikky

    10/30/2018, 11:17 PM
    So, I want to get into microcontrollers, which ones can I use with kotlin?
    j
    n
    13 replies · 3 participants
  • g

    gaetan

    10/31/2018, 9:16 AM
    I’m trying to build the template idea project Kotlin (Mobile Android/iOS). When I launch the gradle build I have this error:
    > Task :app:compileKotlinIos
    xcrun: error: SDK "iphonesimulator" cannot be located
    xcrun: error: SDK "iphonesimulator" cannot be located
    xcrun: error: unable to lookup item 'Path' in SDK 'iphonesimulator'
    exception: org.jetbrains.kotlin.konan.KonanExternalToolFailure: The /usr/bin/xcrun command returned non-zero exit code: 1.
            at org.jetbrains.kotlin.konan.exec.Command.handleExitCode(ExecuteCommand.kt:100)
            at org.jetbrains.kotlin.konan.exec.Command.getOutputLines(ExecuteCommand.kt:91)
    XCode is installed and I can run the simulators from there. I don’t understand why the paths are not correct. Any idea?
    s
    5 replies · 2 participants
  • d

    Dominaezzz

    10/31/2018, 1:27 PM
    Where is
    MPPTools.defaultHostPreset
    defined? (used in the `build.gradle`s of the samples).
    t
    2 replies · 2 participants
  • s

    se1by

    10/31/2018, 3:35 PM
    Hey guys, I have a few issues with my project setup using IntellJ 2018.2.5 with the gradle plugin: 1) I don't have any autocompletion for 1.3 methods. e.g.
    1.toByte()
    does autocomplete,
    1.toUInt()
    does not. 2) My source directory (src/main/kotlin) is not marked as a source directory, which is a bit inconvenient. Already tried adding it explicitly by adding
    main.kotlin.srcDirs += 'src/main/kotlin/'
    to sourceSets 3) IntelliJ seems to think my package declaration should be
    package kotlin.normal.package.name
    instead of
    package normal.package.name
    Any ideas?
    l
    1 reply · 2 participants
  • j

    Jurriaan Mous

    10/31/2018, 5:01 PM
    In what cases are objects like MutableList automatically frozen? I have a frozen array inside a mutable list but I cannot find the cause. Is there an easy way to debug it?
    k
    o
    10 replies · 3 participants
  • h

    Hamza

    11/01/2018, 4:58 AM
    hi, is kotlin native with arduino possible? I’m participating in a competition next week and i want to use arduinos. I want to try using arduino with kotlin/native!
    g
    m
    8 replies · 3 participants
  • a

    agrosner

    11/01/2018, 1:03 PM
    if its android-jvm then yes
    i
    r
    4 replies · 3 participants
  • e

    Ellen Shapiro

    11/01/2018, 1:36 PM
    I’ve been banging my head on this for a minute and could use some help: I’m trying to use
    ktor
    in an MPP iOS/Android project. As far as I can tell, you have to be able to use Coroutines to do this. I can get coroutines importing on gradle 4.10.2 to Android and the core thing, but they don’t work on iOS. I’m seeing some stuff about needing 4.7, but that’s not working either. Anyone got suggestions for how/if I can actually get this to work?
    r
    10 replies · 2 participants
  • b

    bootstraponline

    11/01/2018, 1:39 PM
    I have a simple ktor example that works on iOS https://github.com/bootstraponline/run_blocking
    e
    y
    4 replies · 3 participants
  • e

    Ellen Shapiro

    11/01/2018, 3:22 PM
    I think part of it is that K/N doesn’t support coroutines off the main thread - does anyone know if there’s some place where an explanation of why is posted?
    k
    r
    15 replies · 3 participants
  • o

    olonho

    11/02/2018, 3:03 PM
    (repost of https://discuss.kotlinlang.org/t/clion-and-kotlin-native-1-3/10141) To ensure people who are focusing on pure native development feel good, along with the native support for MPP in Kotlin 1.3 we are happy to release Kotlin/Native support in the CLion IDE . Plugin can be installed into CLion 2018.3 EAP (183.4139), and allows to work with projects described using multiplatform Gradle DSL. Kotlin/Native samples were converted to MPP format, and can be opened in the CLion. Unfortunately, Groovy support is not included in CLion, so editing Gradle build files with the proper highlighting is not yet possible, but we are working on improving the situation here.
    👍 9
    🎉 10
    a
    l
    +1
    6 replies · 4 participants
  • b

    budioktaviyan

    11/02/2018, 4:46 PM
    Guys, Is there anyway to read a json file in the common code ? let say, I want to read a dummy json file to be parsed later using kotlin serialization
    k
    o
    +1
    8 replies · 4 participants
  • m

    Matej Kormuth

    11/03/2018, 3:08 PM
    Are there any plans to add support for viewing source code in IntelliJ (or others JB IDEs) for std library functions / langauge features? Because when I ctrl-click to
    "".cstr
    I only get to see function header with no body (only
    /* compiled code */
    comment).
    ➕ 5
    n
    g
    5 replies · 3 participants
  • q

    Quang Luong

    11/03/2018, 3:14 PM
    the doc seem oudated, what is the correct way to do kotlinString.cstr.getPointer(nativeHeap /*require autoFreeScope*/) (without writing a C function)
    o
    4 replies · 2 participants
  • e

    elifarley

    11/03/2018, 4:11 PM
    Hi, are there any plans to provide an opt-in memory management based on ownership, similar to Rust ? I guess this could be important for high-performance systems programming, am I right?
    d
    l
    +3
    57 replies · 6 participants
  • h

    Hunter Breathat

    11/03/2018, 4:40 PM
    Hey so I was directed here as I'm currently have issues setting up kotlin native via Intellij ultimate. My issue is that it is not grabbing the dependencies from the pre-generated urls. Sorry if this seems stupid but I'm new to kotlin native
    t
    o
    6 replies · 3 participants
  • h

    Hunter Breathat

    11/04/2018, 3:51 PM
    Hey are we able to return more than 1 value or does that still require the Pair work around
    o
    g
    +1
    6 replies · 4 participants
  • n

    nestserau

    11/05/2018, 9:47 AM
    Good day! I’ve created an MPP project in IntelliJ CE and these are the warnings that I get in build.gradle for every property actually. What does it mean and how do I fix it?
    h
    r
    7 replies · 3 participants
  • m

    mersan

    11/05/2018, 2:08 PM
    Hi, which IDE do you use for Kotlin Native?
    h
    m
    +2
    6 replies · 5 participants
  • h

    Hunter Breathat

    11/05/2018, 3:08 PM
    Hey guys so I'm working on a project(personal) and I'm new to kotlin native I understand that it can Interop with C and when I'm using getenv and printing it to console it's stating CPointer then giving me the address of the pointer how to I have that returned as a String for example. I know that CPointer s are not nullable unless using null safes. What should I do
    m
    o
    3 replies · 3 participants
  • s

    Sangeet

    11/05/2018, 5:02 PM
    I getting Illegal State Exception when I am invoking higher order function from
    dispatch_async_f(...)
    k
    o
    25 replies · 3 participants
  • c

    czuckie

    11/05/2018, 6:42 PM
    hey guys, is CLion the best way to develop kotlin native still? or we on intellij these days?
    r
    o
    +2
    7 replies · 5 participants
  • k

    katokay

    11/05/2018, 8:13 PM
    Even though I’m sure kotlin-native within the context iOS development is mostly focused around the native side. Has there been any thoughts or considerations around leveraging kotlin-js & kotlin-native together? There’s a compelling reason to use js for the runtime like react-native to ease the deployment for bugfixes, etc. ala CodePush / over-the-air updates. That said, a seamless interop exchange between the native layer and the JS layer would be very interesting. Is this already possible with multi-platform projects? Is this crazy?
    l
    r
    +1
    6 replies · 4 participants
Powered by Linen
Title
k

katokay

11/05/2018, 8:13 PM
Even though I’m sure kotlin-native within the context iOS development is mostly focused around the native side. Has there been any thoughts or considerations around leveraging kotlin-js & kotlin-native together? There’s a compelling reason to use js for the runtime like react-native to ease the deployment for bugfixes, etc. ala CodePush / over-the-air updates. That said, a seamless interop exchange between the native layer and the JS layer would be very interesting. Is this already possible with multi-platform projects? Is this crazy?
l

louiscad

11/05/2018, 8:26 PM
Makes me think about this: https://gist.github.com/sdeleuze/0da8c3d6a43c659977a16e017020503b
r

russhwolf

11/05/2018, 8:29 PM
Multiplatform doesn't give you anything new for communication between platforms. It's just for compile-time code-sharing.
k

katokay

11/05/2018, 8:32 PM
@louiscad I agree, it’s in the same spirit of those thoughts. It feels like Kotlin is extremely well positioned to do something very interesting (more so than already).
@russhwolf It could though in theory. If a js dependency could be fulfilled via a kotlin-native library for example. So using an example. The core app targeting both iOS and Android could “expect” to call an api to return the step count for the device. On Android the “actual” implementation would be a JVM implementation and return to the JS layer in the same way it does today with react-native sans “native modules” setup. On iOS the “actual” implementation would be the iOS SDK’s also avoiding the native interop concerns, or at least hides it away. I realize I’m probably naive in some of my thoughts, but it doesn’t seem a far stretch.
r

russhwolf

11/05/2018, 8:56 PM
You can't plug-and-play between different platforms the way you're describing. There's no way to "fulfill a js dependency with a kotlin-native library" because they're different platforms that compile to different formats. And when you want your JVM layer to "return to the JS layer in the same way it does today with react-native", now you're losing your seamless interop because you've added a JS bridging layer. That said, there's still a lot of potential around code-sharing. You just shouldn't assume it gives you any ability to move between platforms at runtime other than what already exists.
u

uli

11/05/2018, 9:23 PM
You could teach the compiler to generate a js/ios bridge layer
View count: 1