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
  • t

    thevery

    07/16/2018, 2:31 PM
    BTW why not GitHub? @spierce7
    s
    a
    • 3
    • 2
  • a

    Aregev2

    07/16/2018, 4:16 PM
    What kind of reflections does K/N support?
    fun main(args: Array<String>) {
        println(reflect())
        println(::reflect.returnType)
    }
    
    fun reflect() = "Reflecting"
    m
    • 2
    • 6
  • n

    napperley

    07/17/2018, 12:13 AM
    Is there documentation available on migrating from the konan Gradle plugin to the new Gradle plugin?
    i
    • 2
    • 1
  • n

    napperley

    07/17/2018, 2:18 AM
    Is there a way to refer to a Klib (in a Maven repo, eg https://dl.bintray.com/e5l/http-client-common) using the konan Gradle plugin?
    t
    • 2
    • 1
  • s

    spierce7

    07/17/2018, 5:28 AM
    I'm struggling with Kotlin and toll-free bridging with CF APIs. Code Sample and output are in the thread. 1. Is there a better way I should be using toll-free bridging in Kotlin? It seems almost automatic in Swift. 2.
    CGWindowListCopyWindowInfo()
    returns an Array of Maps. When I bridge the result with
    CFBridgingRelease()
    , the result is an NSArray of Kotlin maps. Why can't it be a kotlin Array of Kotlin maps? Is there a way for me to manually bridge an NSArray to a Kotlin Array?
    s
    • 2
    • 3
  • s

    spierce7

    07/17/2018, 5:52 PM
    In case anyone is interested in kotlinx.coroutines for Kotlin/native: https://github.com/Kotlin/kotlinx.coroutines/issues/246#issuecomment-405647890
    t
    • 2
    • 2
  • t

    thevery

    07/17/2018, 9:11 PM
    Ok, there is
    "org.jetbrains.kotlinx:kotlinx-coroutines-core-native_release_ios_x64:0.23.4-native-1"
    for native coroutines, but I cannot find UI context - is there any available? @elizarov
    e
    • 2
    • 3
  • m

    Mohit Gurumukhani

    07/18/2018, 12:02 AM
    Hey! I am having troubles running kotlin-platform-native plugin to run on Appcode to write Native ios apps (without using any objective c or swift kinda like the sample app). However, I see that kotlin-platform-native plugin adds a compileDebugIos_x64KotlinNative task while appcode wants compileKonan<projectName>Ios_x64 as task while building at least in Appcode. I was wondering if using Konan and Kotlin plugins is the intended use in this case instead of kotlin-platform-native plugin?
    e
    i
    • 3
    • 3
  • a

    Aregev2

    07/19/2018, 8:10 AM
    I compiled a simple program to wasm, how do I load it inside a
    .html
    file?
    s
    • 2
    • 2
  • a

    Aregev2

    07/19/2018, 1:11 PM
    Um, I just wanted to try the new random implementation in K/N:
    fun main(args: Array<String>) {
        val ls = listOf(12, 23, 435).shuffled()
        println(ls[0])
    }
    I have been using this code, and got that output
    Uncaught exception from Kotlin's main: kotlin.IndexOutOfBoundsException
            at kfun:kotlin.Exception.<init>()kotlin.Exception (0x4068b2)
            at kfun:kotlin.RuntimeException.<init>()kotlin.RuntimeException (0x4067e2)
            at kfun:kotlin.IndexOutOfBoundsException.<init>()kotlin.IndexOutOfBoundsException (0x406762)
            at kfun:kotlin.collections.ArrayList.checkIndex#internal (0x40de44)
            at kfun:kotlin.collections.ArrayList.get(<http://kotlin.Int|kotlin.Int>)#GENERIC (0x40feb7)
            at kfun:kotlin.collections.shuffle@kotlin.collections.MutableList<#GENERIC>.()Generic (0x41b89f)
            at kfun:kotlin.collections.shuffled@kotlin.collections.Iterable<#GENERIC>.()Generic (0x41c109)
            at kfun:main(kotlin.Array<kotlin.String>) (0x403e85)
            at EntryPointSelector (0x403d06)
            at Konan_start (0x403c77)
            at Konan_run_start (0x403bf2)
            at Konan_main (0x403b67)
            at __libc_start_main (0x7f57da6f0b97)
            at  (0x403a0a)
            at  ((nil))
    a
    p
    • 3
    • 9
  • a

    Aregev2

    07/19/2018, 5:39 PM
    And how can make the K/N compiler to generate llvm IR?
    s
    • 2
    • 1
  • a

    Aregev2

    07/19/2018, 6:15 PM
    Can I compile to MacOS via linux host, is it possible?
    i
    • 2
    • 1
  • b

    bipin

    07/19/2018, 7:55 PM
    guy, i getting stranger error when building simple K/N app.
    D8: Program type already present: com.moviemaker.BuildConfig
    
    > Task :android-app:transformDexArchiveWithDexMergerForDebug FAILED
    java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
    • 1
    • 2
  • s

    spierce7

    07/19/2018, 9:57 PM
    How long will it be until we get exceptions with line numbers?
    d
    m
    t
    • 4
    • 6
  • s

    spierce7

    07/20/2018, 1:28 AM
    Can anyone tell me, what is the value of using https://github.com/Kotlin/kotlinx.atomicfu over just using atomic references? It seems like it provides an API like an atomic reference, but a lot of work has gone into this library, and I just don't understand the value it provides. I know I'm missing something, I just can't figure out what.
    g
    e
    • 3
    • 8
  • j

    jw

    07/20/2018, 2:40 AM
    never any love for the other other platform
    n
    e
    +2
    • 5
    • 7
  • b

    bipin

    07/20/2018, 3:28 PM
    getting error while building
    > Task :common-ios:compileKonanKotlinMovieMakerIos_x64 FAILED
    error: compilation failed: Expected data layout hash: -6046314956093995674 but actual is: 4180466727156567408
    r
    t
    s
    • 4
    • 16
  • a

    alexfacciorusso

    07/20/2018, 4:02 PM
    Hi guys! I'm writing a multiplatform project, made by a shared core (managed by the
    kotlin-platform-common
    plugin), and Android part, and an iOS framework I am building with
    konan
    , that then I load into an iOS app project. There's a problem: It seems that in the konan gradle project I can't import external libraries from gradle (I need the
    org.jetbrains.kotlinx:jsonparser-native:0.6.0
    library, since I'm using
    kotlinx-serialization-runtime-common
    in the shared code). How to do it?
    s
    • 2
    • 1
  • t

    thevery

    07/21/2018, 2:21 PM
    @olonho should I file an issue for this?^
    a
    • 2
    • 1
  • a

    Aregev2

    07/22/2018, 1:02 PM
    Are there any plans for supporting Android x86 & Windows x86?
    m
    • 2
    • 1
  • t

    thevery

    07/23/2018, 1:11 AM
    With coroutines yet to be released for iOS, what is the proper way in common code for 1) cross-thread access for some models (not simple stateless objects) 2) thread switching (ui->bg->ui) I want to achieve something like
    fun search(query: String, model: SearchModel, view: SearchView): Job {
            val cancellableJob = launch(CommonPool) {
                val data = model.search(query) // (1)
                withContext(UI) {
                    view.showData(data) (2)
                }
            }
            return cancellableJob
        }
    r
    m
    • 3
    • 9
  • r

    russhwolf

    07/24/2018, 2:26 AM
    Can the
    kotlin-platform-native
    plugin create objective-c frameworks or is that only supported in
    konan
    for that for now?
    m
    a
    • 3
    • 5
  • a

    Aregev2

    07/24/2018, 1:33 PM
    I am trying to create a binding for
    time.h
    header and the cinterop tool throws an exception, can someone help? time.def
    headers = /usr/include/time.h
    compilerOpts = -std=c99
    Exception in thread "main" java.lang.Error: /usr/include/time.h:37:10: fatal error: 'bits/types/clock_t.h' file not found
    	at org.jetbrains.kotlin.native.interop.indexer.UtilsKt.ensureNoCompileErrors(Utils.kt:137)
    	at org.jetbrains.kotlin.native.interop.indexer.IndexerKt.indexDeclarations(Indexer.kt:902)
    	at org.jetbrains.kotlin.native.interop.indexer.IndexerKt.buildNativeIndexImpl(Indexer.kt:892)
    	at org.jetbrains.kotlin.native.interop.indexer.NativeIndexKt.buildNativeIndex(NativeIndex.kt:56)
    	at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLib(main.kt:284)
    	at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.interop(main.kt:38)
    	at org.jetbrains.kotlin.cli.utilities.InteropCompilerKt.invokeInterop(InteropCompiler.kt:100)
    	at org.jetbrains.kotlin.cli.utilities.MainKt.main(main.kt:29)
    s
    m
    • 3
    • 9
  • b

    bipin

    07/24/2018, 3:25 PM
    guys, Since last few week, I am figuring out which the best cross-platform app development tool among Flutter and Kotlin/Native?
    a
    s
    +4
    • 7
    • 10
  • a

    Aregev2

    07/24/2018, 3:57 PM
    How can I convert
    CPointer<IntVar>
    to
    IntArray
    ?
    m
    • 2
    • 1
  • d

    Dominaezzz

    07/25/2018, 11:56 AM
    Where can I keep track of Kotlin/Native support in Clion on Windows? I read the CMake won't be fixed on Windows since gradle support is coming. Where can I also keep track of that?
    a
    t
    +2
    • 5
    • 5
  • m

    Mohit Gurumukhani

    07/25/2018, 8:36 PM
    Hey! I am having trouble using the http client for Kotlin/Native as given by https://github.com/e5l/http-client-common. I am getting a memory leak along with the error message ‘Uncaught exception from Kotlin's main: kotlin.IllegalStateException: There is no event loop. Use runBlocking { ... } to start one’. I do have runBlocking surrounding the calling code. Can anyone give me an example of how to use the client? My code is in the thread.
    e
    t
    • 3
    • 5
  • d

    Dominaezzz

    07/26/2018, 2:44 PM
    Has anyone had any success using Clion with WSL? When I change the toolchain to WSL, Clion still looks at my windows home instead of WSL home for the kotlin compiler.
    v
    s
    • 3
    • 4
  • s

    spierce7

    07/26/2018, 9:59 PM
    @elizarov since you recently closed https://github.com/Kotlin/kotlinx.coroutines/issues/246#event-1755639139 is there anything I can track for being able to use coroutines to cross thread boundaries in kotlin/native?
    e
    t
    • 3
    • 2
  • s

    spierce7

    07/26/2018, 10:00 PM
    Does anyone know of anything I can use to track Gradle integration for kotlin/native into AppCode?
    v
    • 2
    • 5
Powered by Linen
Title
s

spierce7

07/26/2018, 10:00 PM
Does anyone know of anything I can use to track Gradle integration for kotlin/native into AppCode?
v

Vyacheslav Karpukhin [JB]

07/26/2018, 10:10 PM
https://youtrack.jetbrains.com/issue/KT-25759
s

spierce7

07/26/2018, 10:15 PM
Thanks for that 🙂
@Vyacheslav Karpukhin [JB] After gradle integration, will code completion and other features for Kotlin/native be available in other IDE's, or will it still only really be AppCode and CLion?
v

Vyacheslav Karpukhin [JB]

08/03/2018, 3:04 PM
We're considering K/N support in other IDEs, but I cannot share any estimates on when it's going to arrive and how it's going to look.
s

spierce7

08/03/2018, 3:10 PM
So integrating K/N with Gradle won't just add support to other IDEs for free then
View count: 3