https://kotlinlang.org logo
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
  • o

    oleksandr.stepanov

    10/19/2018, 4:04 PM
    I see. So how to detect which library will be available in both: Kotlin and Kotlin-Native, aka Android and iOS?
    s
    r
    • 3
    • 7
  • m

    Matej Kormuth

    10/19/2018, 4:18 PM
    Hey, Is is possible to debug kotlin/native (using multiplatform project) application in IntelliJ EAP?
    d
    c
    • 3
    • 6
  • j

    Jaroslav

    10/22/2018, 10:59 AM
    I have an interface described in kotlin:
    interface Transport {
        suspend fun <T : Any> send(command: Command<T>, data: String): String
    }
    but when generated ios framework, there is no such method generated:
    __attribute__((swift_name("Transport")))
    @protocol IosTransport
    @required
    @end;
    what’s wrong?
    s
    t
    s
    • 4
    • 9
  • h

    hultgren

    10/22/2018, 11:07 PM
    With the konan plugin it’s possible to name a framework artifact, but I can’t find a corrensponding way of naming a framework artifact using the org.jetbrains.kotlin.platform.native plugin. Is it not possible or am I missing something?
    t
    • 2
    • 2
  • y

    yuya_horita

    10/23/2018, 2:29 AM
    o
    k
    s
    • 4
    • 18
  • s

    spierce7

    10/23/2018, 3:17 AM
    @olonho How expensive is attaching and detaching an object from a thread? If I have a List with 100,000 items, should I worry about performance for attaching and detaching objects from a thread?
    o
    k
    • 3
    • 9
  • i

    Ivan

    10/23/2018, 1:54 PM
    Hey, guys, is kotlin/native on windows still not a thing?
    s
    l
    +4
    • 7
    • 14
  • m

    miha-x64

    10/23/2018, 6:34 PM
    Which way Kotlin-Native deals with Strings? I mean, '65K chars will be enough for everyone' was a mistake, UTF-16 has surrogate pairs, and Java's 16-bit `char`s are not actually characters (graphemes), just UTF-16 words. And I really like the way Rust deals with strings: 'UTF-8 everywhere' and 'grapheme cluster is a thing'. Sorry if the answer is obvious, I've never read anything about KN.
    d
    n
    +2
    • 5
    • 6
  • j

    Jaroslav

    10/24/2018, 7:31 AM
    I’m trying to use ios framework built from kotlin and getting this runtime error:
    NSForwarding: warning: object 0x60000140a800 of class 'MyLib_stage.RpcTransport' does not implement methodSignatureForSelector: -- trouble ahead
    Unrecognized selector -[MyLib_stage.RpcTransport toKotlin:]
    What are
    methodSignatureForSelector
    and
    toKotlin
    methods?
    s
    • 2
    • 2
  • s

    Sam

    10/24/2018, 12:46 PM
    I think you’re missing a Coroutines context.
    j
    • 2
    • 7
  • b

    bootstraponline

    10/24/2018, 6:11 PM
    No enum constant org.jetbrains.kotlin.konan.MetaVersion.RC
    has anyone seen this issue before? i updated to
    1.3.0-rc-146
    and gradle errors.
    o
    • 2
    • 4
  • b

    bootstraponline

    10/25/2018, 1:54 PM
    I compiled my simple example to an iOS framework. The
    GitHubKt.getGitHub()
    call hangs forever on iOS. Is that expected or a bug? https://github.com/bootstraponline/run_blocking
    o
    • 2
    • 5
  • b

    bootstraponline

    10/25/2018, 1:59 PM
    this is what Xcode displays when I pause execution with the debugger.
    s
    • 2
    • 2
  • k

    Karen

    10/25/2018, 7:16 PM
    Hello! I noticed that there was some updates to the documentation enable bitcode in kotlin frameworks: https://github.com/JetBrains/kotlin-native/blob/master/FAQ.md#q-how-do-i-enable-bitcode-for-my-kotlin-framework I was trying to implement this in on of the kotlin examples (mmp-iOS-Android) with kotlin plugin version is: 1.3.0-rc-190-Studio3.2-1 and I get the warning the following warning:
    warning: flag is not supported by this version of the compiler: -Xembed-bitcode
    and the generated frameworks do not contain bitcode. I was wondering what I'm doing wrong and how can I necessarily update the version of the compiler?
    o
    • 2
    • 2
  • e

    Ellen Shapiro

    10/26/2018, 9:19 AM
    👋 I asked this on twitter a few days ago but figured I’d come straight to the source and see if anyone here had any bright ideas:
    NSString.create
    returns an
    NSString
    , but I’m getting
    cast will never succeed
    errors when I try to do a cast from
    NSString
    to a kotlin string
    l
    s
    • 3
    • 9
  • m

    Matej Kormuth

    10/26/2018, 10:04 AM
    I have library, that has function with header like
    int func(const char* src...);
    that I use with cinterop. I want to pass inside
    CPointer<ByteVar>
    or
    CPointer<UByteVar>
    as a parameter (because char* is pointer to char) that a aquired from previous native call. However the function has in kotlin binding header
    public fun func(source: kotlin.String?...
    accepting kotlin string. How do I do it? Do I need to call
    toKString()
    ? Doesn't
    toKString()
    involve some allocation? Does it correctly translates the
    CPointer<ByteVar>
    buffer to string (without some corruption due to encoding for example)? Isn't it useless step as the KString will have to be translated back to C char array later?
    m
    • 2
    • 6
  • s

    Steven McLaughlin

    10/26/2018, 5:31 PM
    I'm not sure if this is the right place to ask... if not, let me know and I can remove this: I made a little kotlin app that I've been using at work to aggregate some information from our github repositories and improve my workflow. Right now it's just spitting out big chunks of formatted text to tell me things, but I wanted to build a UI around it. I was debating between making a web front-end, or potentially just having it as a desktop app. If I were to go with the desktop app, would kotlin native be a good option to build out that ui? (It only needs to work on mac).
    o
    • 2
    • 2
  • b

    bootstraponline

    10/26/2018, 5:32 PM
    you may want to look into electron
    :trollface: 1
    ➖ 7
    👎 2
    👍 1
    s
    j
    • 3
    • 6
  • r

    Ruckus

    10/26/2018, 6:33 PM
    Go with #tornadofx
    👍 2
    :kotlin: 2
    👌 1
    s
    • 2
    • 2
  • p

    patjackson52

    10/27/2018, 1:36 AM
    I know its not much to go on, but anyone experiencing this crash when building common multiplatform module? I get it with most of the build tasks (build, assemble, iosKlibrary). kotlin version=1.3.0-rc-198, konan version = 0.9.3-release-4233:
    Configure project :common
    Kotlin Multiplatform Projects are an experimental feature.
    Task :common:compileKotlinIos
    error: compilation failed: null * Source files: ExpectSuccess.kt, MyFile.kt, Extensions.kt, GameEngine.kt, Constants.kt * Compiler version info: Konan: 0.9.3 / Kotlin: 1.3.0 * Output kind: LIBRARY exception: kotlin.KotlinNullPointerException org.jetbrains.kotlin.backend.konan.optimizations.Devirtualization$DevirtualizationAnalysis$InstantiationsSearcher.processVirtualCall(Devirtualization.kt:281)
    o
    • 2
    • 2
  • j

    jkbbwr

    10/27/2018, 5:04 AM
    I can't find a single working example of how to setup a gradle kts project from clion.
    o
    • 2
    • 1
  • t

    tadej

    10/28/2018, 10:59 AM
    Hi all, I'm trying to create a simple Android/iOS multiplatform project (https://kotlinlang.org/docs/tutorials/native/mpp-ios-android.html#creating-the-shared-module) using IDEA CE. I'm running into issues with the
    iosMain
    module, where the IDE complains about Kotlin not being configured, while
    androidMain
    and
    common
    dir/module work fine. I've added it as a
    sourceSet
    in
    build.gradle
    , with and without the stdlib, tried the plugin DSL, restarted the IDE, invalidated caches, all with no avail. Additionally, there seem to be no native dependencies available, meaning any import from e.g.
    platform
    is unrecognized. I've added the
    <https://dl.bintray.com/jetbrains/kotlin-native-dependencies>
    repo, but the issue remains. Any ideas on how to resolve the two problems?
    o
    • 2
    • 2
  • h

    Hamza

    10/29/2018, 12:24 AM
    Hi, everyone. I am trying to get up and running with Kotlin/Native, using GLFW3, but I have a few questions and I find the pages on Github and KotlinLang a bit confusing. I have already built the GLFW3 Source into .A files, which are located in ~/Downloads/glfw/src/libglfw.a The example on gitchurn has this following def file:
    headers = git2.h
    linkerOpts.osx = -L/opt/local/lib -L/usr/local/lib -lgit2
    linkerOpts.linux = -L/usr/lib64 -L/usr/lib/x86_64-linux-gnu -lgit2
    headerFilter = git2/** git2.h
    Why is this using .h files? And if I have .a files what reference should I follow to get it working?
    o
    d
    • 3
    • 7
  • m

    msink

    10/29/2018, 10:28 AM
    1.3.0 🎉
    👍 3
    🎉 17
    l
    j
    o
    • 4
    • 4
  • k

    Konstantin Petrukhnov

    10/29/2018, 12:20 PM
    What have you broke this time in my code? 😄 Lets see....
    l
    • 2
    • 3
  • j

    Jaroslav

    10/29/2018, 2:31 PM
    Is there a way to propagate
    Deferred
    object to swift?
    s
    • 2
    • 2
  • h

    Hamza

    10/29/2018, 3:13 PM
    I’m trying to get a simple glfw project started up, and i’m getting errors. Project: https://gitlab.com/hhhapz/glfw-setup-kotlin I’m thinking this has to be an issue with my dependencies, as when it’s a simple main function with nothing, i do not get any errors with building my code. can anyone else add any ideas why this might fail, and how i could fix?
    o
    m
    +2
    • 5
    • 7
  • m

    McEna

    10/30/2018, 5:58 AM
    Sorry to bother you folks, but I'm a bit lost. I'm building a kotlin multiplatform library as a standalone project. Once I import the android and java artifacts into a separate project, gradle asks for the jar generated for the common module as $projectName:undefined, like a maven artifact with no groupId and no version, and neither deploying the artifact with a groupId to mavenLocal or pasting it into /libs work. How should I be doing this?
    o
    • 2
    • 2
  • a

    adeln

    10/30/2018, 12:20 PM
    hey folks! Where can I read about the current memory and concurrency model of kotlin/native: • does it have a GC in the runtime , or automatic ref counting? • are concurrency memory model and guarantees the same as in kotlin/jvm? • what’s the current story and the plans for C ABI?
    j
    g
    • 3
    • 10
  • s

    Sebastian Owodzin

    10/30/2018, 2:13 PM
    Hi, Anyone knows how can I overwrite the iOS framework name in build.gradle? I'm using a generated multiplatform project from IDEA
    kotlin {
        targets {
            fromPreset(presets.jvm, 'jvm')
            // This preset is for iPhone emulator
            // Switch here to presets.iosArm64 to build library for iPhone device
            fromPreset(presets.iosX64, 'ios') {
                compilations.main {
                    outputKinds('FRAMEWORK')
                }
                //customFrameworkName??
            }
        }
    ...
    o
    h
    • 3
    • 4
Powered by Linen
Title
s

Sebastian Owodzin

10/30/2018, 2:13 PM
Hi, Anyone knows how can I overwrite the iOS framework name in build.gradle? I'm using a generated multiplatform project from IDEA
kotlin {
    targets {
        fromPreset(presets.jvm, 'jvm')
        // This preset is for iPhone emulator
        // Switch here to presets.iosArm64 to build library for iPhone device
        fromPreset(presets.iosX64, 'ios') {
            compilations.main {
                outputKinds('FRAMEWORK')
            }
            //customFrameworkName??
        }
    }
...
o

olonho

10/30/2018, 2:33 PM
https://github.com/JetBrains/kotlin-native/blob/master/FAQ.md#q-how-do-i-specify-a-custom-objective-c-prefixname-for-my-kotlin-framework
h

hultgren

10/30/2018, 4:14 PM
@Sebastian Owodzin: let me know if you get it to work with the
-module_name
option. When I tried it out I couldn’t get it to do more than just change the prefix of the obj-c exports, not the framework itself
s

Sebastian Owodzin

07/23/2019, 3:54 PM
@hultgren I got it to work with:
kotlin {
    targets {
        fromPreset(iosTarget, 'ios') {
            binaries {
                framework("customName") {
                    ...
                }
            }
        }
    }
}
h

hultgren

07/23/2019, 4:24 PM
@Sebastian Owodzin: yeah thank you. I recently revisited this as well and seems like it works fine now 👍
👍 1
View count: 2