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

    11/29/2018, 9:15 PM
    kotlix.serialization compilation fails on custom serializer with
    error: compilation failed: org.jetbrains.kotlin.ir.declarations.lazy.IrLazyFunction@550c973e
    
     * Source files: Sample.kt, SampleIos.kt
     * Compiler version info: Konan: 1.0.2 / Kotlin: 1.3.0
     * Output kind: LIBRARY
    
    exception: java.lang.IllegalStateException: org.jetbrains.kotlin.ir.declarations.lazy.IrLazyFunction@550c973e
            at org.jetbrains.kotlin.backend.konan.llvm.LlvmDeclarations.forFunction(LlvmDeclarations.kt:44)
    should I file bug to #kotlin-native or to #serialization ?
    s
    • 2
    • 4
  • g

    gildor

    11/30/2018, 10:07 AM
    I have a param of C function with reference to reference
    **variable
    (this type generated by interop:
    CValuesRef<COpaquePointerVar>
    ). So in C you pass reference to this reference (like
    &variable
    ). How can I do this in K/N?
    s
    • 2
    • 2
  • s

    Slackbot

    11/30/2018, 5:37 PM
    This message was deleted.
    t
    k
    • 3
    • 2
  • k

    kpgalligan

    11/30/2018, 8:09 PM
    So, debugging. What are people doing to debug native code? Specifically I have either command line tests running on a mac or a framework running inside an ios app. My "debugging" is currently log statements. That round trip is pretty terrible. Something better? lldb or similar?
    👍 1
    p
    t
    +3
    • 6
    • 6
  • p

    pajatopmr

    11/30/2018, 10:13 PM
    Any CLion Users in the channel who have used it for code coverage and would care to give a clue on how a CLion newbie can leverage the tool while Kotlin Native has no support for code coverage? @msink
    m
    • 2
    • 3
  • t

    toomanyeduardos

    11/30/2018, 10:26 PM
    does anyone have an example of how to call Ktor from the commonMain? everything i find is for kotlin android, or js
    o
    • 2
    • 2
  • t

    toomanyeduardos

    11/30/2018, 10:45 PM
    let me ask in a different way. is there a simple sample of something making a network call in Kotlin Native? i would assume this would be done from commonMain
    r
    m
    • 3
    • 2
  • j

    jkbbwr

    12/01/2018, 2:32 AM
    Is there a way to force the compiler to bundle the definition to
    Kotlin_Int_plus_Int
    into the bitcode file?
    s
    • 2
    • 6
  • t

    toomanyeduardos

    12/01/2018, 3:45 AM
    this may be a dumb question, but I created a KN class that has 2 functions: one is a regular
    fun
    and the other one is a
    suspend fun
    , which is using coroutines to make a network call. on android, i can see both functions from this class. i can call them, and life is good. on ios, I can only see the function that is a regular
    fun
    . the
    suspend fun
    is not visible at all. what did i miss? does iOS not support suspending functions from coroutines?
    y
    j
    • 3
    • 33
  • e

    elect

    12/01/2018, 12:36 PM
    it looks so:
    elect@elect-NUC8i5BEK:~/CLionProjects/kotlin-native-opengl-tutorial$ ls /usr/include/GL/
    glcorearb.h   glext.h       gl_mangle.h   glu_mangle.h  glxext.h      glxint.h      glxmd.h       glxtokens.h   wglew.h       
    glew.h        gl.h          glu.h         glxew.h       glx.h         glx_mangle.h  glxproto.h    internal/
    m
    • 2
    • 2
  • e

    elect

    12/01/2018, 2:43 PM
    @svyatoslav.scherbina, why?
    s
    • 2
    • 2
  • e

    elect

    12/01/2018, 4:05 PM
    error: invalid argument: -linkerArgs
    here https://github.com/perses-games/konan-sfml/blob/master/build.sh#L25
    m
    d
    • 3
    • 58
  • p

    pajatopmr

    12/01/2018, 4:22 PM
    A high interest topic for me is code coverage support for Kotlin multiplatform, especially native targets. Understandably, there is a dearth of information about JB roadmap plans for native code coverage tools. If I have this wrong I would love to hear it. So that leaves me with standalone solutions for now, like gcov and related tools, of which I know next to nothing having been focused on JVM since ’95. While I did do C and C++ for a number of years, code coverage did not cross my radar until a few years ago and since then it has been all Jacoco which has it’s own set of issues for Kotlin/JVM. So I’m looking for guidance on how to leverage available code coverage tools with the Kotlin/Native compiler. For example, am I limited to tools that support LLVM? Is there a way to hook into GCC/gcov? Feel free to respond in #code-coverage or a thread here.
    👍 1
    o
    • 2
    • 11
  • e

    elect

    12/01/2018, 9:52 PM
    so, I tried to create a glfw helloWorld https://github.com/elect86/glfw,
    cinterop
    is fine, but when it's time to build:
    m
    • 2
    • 2
  • k

    kyonifer

    12/02/2018, 3:25 PM
    I'm trying to export some classes defined in a k/native framework (defined using new-mpp) on iOS target to a consuming swift project. If I just define a simple class
    class Foo
    , this gets added to the generated
    .h
    and seems to work fine. It seems like if I try to subclass an objective c class, such as
    class MyViewController : UIViewController
    , the symbol disappears from the
    .h
    and then swift can't see it. Is this expected behavior? Am I missing something here?
    s
    l
    • 3
    • 7
  • m

    Matej Kormuth

    12/02/2018, 11:03 PM
    does kotlin native support primitive (int, long, float...) arraylists without boxing?
    t
    d
    +2
    • 5
    • 6
  • t

    thevery

    12/04/2018, 11:35 AM
    Am I doing something wrong or
    initWithTimeIntervalSince1970
    is really missing in K/N? I see only
    initWithTimeIntervalSinceReferenceDate
    https://developer.apple.com/documentation/foundation/nsdate?language=objc#topics
    o
    • 2
    • 1
  • k

    kpgalligan

    12/04/2018, 2:18 PM
    I'd like to get some clarification on AtomicReference and memory leaks. In the code comments it says we should null out references to make sure they don't result in leaks, but it seems like they won't always result in leaks. Curious about details. The atomicLazy comment seems to imply cyclic references https://github.com/JetBrains/kotlin-native/blob/master/runtime/src/main/kotlin/kotlin/native/concurrent/Lazy.kt#L115. The Atomics.kt comment just says you should null them out without much detail. While I'll also try to construct shared structures to null out data, if the problematic situations were clear, it would be easier to not have to do that. Thoughts?
    o
    • 2
    • 1
  • j

    JoakimForslund

    12/05/2018, 1:17 PM
    If I place a folder called 'aes' in the same directory as the file 'libaes.def' containing this:
    package = aes
    headers = aes/aes.h
    headerFilter = aes/aes.h
    Why does my multiplatform solution upon build give me this exception:
    Exception in thread "main" java.lang.Error: /var/folders/60/htq84d4s4q55l9j0j1mh6d5w0000gn/T/tmp8457509487070388280.c:1:10: fatal error: 'aes/aes.h' file not found
    d
    m
    • 3
    • 10
  • i

    Ivan

    12/06/2018, 3:53 PM
    Does IOS coroutines
    delay(x)
    not working? trying to create loop thread with
    runBlocking{
                GlobalScope.launch {
                      while(flag){
                      //some stuff
                     delay(1000)
                      }
                 }
    }
    and it drops with error
    kotlin.IllegalStateException: Cannot schedule task because event loop was shut down
    on delay, we are researching atm send help))
    l
    • 2
    • 2
  • t

    thevery

    12/06/2018, 5:04 PM
    @ilya.matveev looks like title should be 1.3.11: https://github.com/JetBrains/kotlin-native/releases/tag/v1.0.3
    i
    • 2
    • 1
  • e

    elect

    12/06/2018, 10:40 PM
    just two annoying things: no auto completition on Idea and no hightlighting on Clion, https://github.com/elect86/glfw Am I doing anything wrong?
    o
    • 2
    • 7
  • a

    andyfleming

    12/07/2018, 12:53 AM
    The docs are terrible around getting started with a project in kotlin native btw 😞
    👍 3
    ➕ 5
    t
    o
    d
    • 4
    • 11
  • d

    Dominaezzz

    12/07/2018, 5:17 PM
    Was there a change to way memory leaks are found? After upgrading to
    1.3.11
    , I now occasionally get this message at the end of my program "C:\BuildAgent\work\4d622a065c544371\runtime\src\main\cpp\Memory.cpp:1150: runtime assert: Memory leaks found"
    o
    • 2
    • 1
  • s

    serebit

    12/07/2018, 6:22 PM
    Any idea when the fix for this issue will make it into release? https://github.com/JetBrains/kotlin-native/issues/2343 It was committed to master, but 1.0.3 doesn’t seem to include the fix.
    m
    o
    • 3
    • 2
  • n

    napperley

    12/08/2018, 10:47 PM
    I have a list of questions that are reserved for the upcoming Kotlin Native webinar: 1. Is there anything in Kotlin Native that will make it easier to handle C libraries that heavily use RC (Reference Counting)? 2. Will any tools/libraries be made available for collecting/extracting meta data from KLibs? 3. Are there libraries available for generating Kotlin source code via Kotlin Native? 4. Is there going to be an option to turn off the Cyclic Collector GC and use Weak References instead? 5. What general performance improvements will be included in future Kotlin Native releases?
    ✅ 2
    👍 2
    d
    m
    +4
    • 7
    • 10
  • i

    Ivan

    12/10/2018, 2:50 PM
    is there is a possibility to add IOS library into k/n project? for example, I want to use socket.io. Can I write wrapper for common module and use external library to provide actual code?
    s
    • 2
    • 1
  • t

    Torbilicious

    12/10/2018, 7:20 PM
    Is there any possibility to increase the stack size of kotlin native programs?
    o
    • 2
    • 1
  • s

    Sam

    12/11/2018, 5:43 AM
    Is the bit code output format the same one that Apple is using or is it different? If I could put a Kotlin app on the Apple Watch or tv that would be awesome.
    o
    • 2
    • 1
  • p

    pavel.v

    12/11/2018, 6:38 PM
    How to get code completion in IntelliJ for kotlin files that were generated from native library?
    d
    r
    • 3
    • 2
Powered by Linen
Title
p

pavel.v

12/11/2018, 6:38 PM
How to get code completion in IntelliJ for kotlin files that were generated from native library?
d

Dominaezzz

12/11/2018, 6:44 PM
Once you build your project you should get code completion.
r

russhwolf

12/11/2018, 6:48 PM
Intellij only supports the multiplatform plugin so make sure you're using
kotlin-multiplatform
and not
kotlin-platform-native
👍 1
View count: 1