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

    hmole

    01/23/2019, 12:48 PM
    Is there any way I can program for Ios targets on my non-Mac machine in IDEA? Not building, just writing code with autocompletion.
    d
    • 2
    • 1
  • w

    waylonbrown

    01/23/2019, 9:49 PM
    What’s a good resource on how Kotlin Native works? I’m looking for all the finer low-level details, not a high level like I get from the documentation
    o
    • 2
    • 2
  • h

    hmole

    01/24/2019, 11:08 AM
    Can K/N team please raise priority for this issue? With compilation speed slow as it is, not beeing able to cache tasks really hurts CI with K/N. Seeing as compilation task already supports
    UP-TO-DATE
    , it shouldn't be hard to implement. https://github.com/JetBrains/kotlin-native/issues/2520
    ➕ 5
    o
    • 2
    • 1
  • l

    louiscad

    01/24/2019, 8:45 PM
    Hi @kpgalligan , do you know if it is possible to make an equivalent of this
    awaitOneClick
    extension function for
    View
    on iOS? https://github.com/LouisCAD/Splitties/blob/8a38de6131b1b41d5404c8f236204cfa7becc3b8/sample/src/main/kotlin/com/louiscad/splittiessample/extensions/coroutines/View.kt#L9-L22
    k
    s
    • 3
    • 6
  • c

    Cyrille QUÉMIN

    01/24/2019, 9:10 PM
    Hey there, I am working on a multiplatform project (android and iOS) and currently dealing with crypto operation on iOS. Thanks to @olonho I managed create an RSA key via
    SecKeyCreateRandomKey
    and `CFBridgingRetain`:
    val privateKeyRef = SecKeyCreateRandomKey(cfKeyGenerationAttributes, error.ptr)
    println("Key generated: ${CFBridgingRelease(privateKeyRef)} ")
    This works nicely. When I try to retrieve my key at later date I have either crashes or the key is not found. I suspect this is due to how I define the application data string tag in my dictionary:
    CFDictionaryAddValue(cfKeyGenerationAttributes,kSecAttrApplicationTag,CFBridgingRetain(keyAlias.wcstr.ptr))
    I tried few combination but I never seem to be able to retrieve the key that is successfully created: it is either crashing or saying that the key is not found. What is the proper way to pass a string to the dictionary and overall to Kotlin Native for Object C?
    o
    s
    • 3
    • 11
  • j

    jkbbwr

    01/24/2019, 11:18 PM
    How theoretical are we talking. How much work to support it
    o
    • 2
    • 3
  • i

    icarumbas

    01/25/2019, 12:33 PM
    Hey guys. I have some problems with network calls via ktor on iosTest module in my multiplatform app. I’ve created an issue here: https://github.com/ktorio/ktor/issues/895 But now i’m really confused about this. I’m not sure if it’s ktor problem. Maybe native and coroutines, especially emulator, idk…
    j
    s
    • 3
    • 20
  • c

    Cyrille QUÉMIN

    01/26/2019, 1:38 PM
    Hey guys, when running some unit tests on iOS sometimes we need to attach the unit tests to a host app. (for example to run unit tests that involves the keychain). This is easy to do through XCode as per the image. Is there a way to have kotlin native/mpp building test frameworks in such a way? If not can you guys think of a workaround that would still allow me to run unit test from gradle?
    t
    • 2
    • 3
  • a

    ansman

    01/28/2019, 1:06 AM
    In C the APIs are usually consumed like this:
    int value;
    getValue(&value);
    return value
    m
    • 2
    • 2
  • c

    coolcat

    01/28/2019, 8:54 AM
    Is there a way of specifying a variable to be
    weak
    or
    unowned
    when running on iOS?
    s
    • 2
    • 4
  • a

    ansman

    01/28/2019, 3:19 PM
    Can I, in an easy way, use a native library when I’m using Kotlin Multiplatform? I have a C library that I’d like to use but as far as I can tell I would have to write a JNI layer anyway
    o
    d
    • 3
    • 12
  • f

    fcosta

    01/28/2019, 5:44 PM
    Hey guys, I’m getting this error when trying to build my project with Kotlin Native.
    * What went wrong:
    A problem occurred evaluating root project 'kotlin-game-engine'.
    > Could not resolve all files for configuration ':detachedConfiguration1'.
       > Could not download kotlin-native-macos.tar.gz (:kotlin-native-macos:1.1.1)
          > Failed to download SHA1 for resource '<https://download.jetbrains.com/kotlin/native/builds/releases/1.1.1/macos/kotlin-native-macos-1.1.1.tar.gz>'.
             > Could not GET '<https://download.jetbrains.com/kotlin/native/builds/releases/1.1.1/macos/kotlin-native-macos-1.1.1.tar.gz.sha1>'. Received status code 403 from server: Forbidden
    t
    o
    • 3
    • 3
  • e

    Eric O'Connell

    01/28/2019, 9:18 PM
    Is there an equivalent to
    @file:JvmName
    for kotlin-native?
    d
    b
    s
    • 4
    • 10
  • n

    Nico Buescher

    01/29/2019, 3:12 PM
    Hello! I'm trying to set up a library and application project with kotlin/native using the multiplatform project kotlin gradle dsl. Two questions: 1. Is it possible to have an expect function defined in a shared library that is then defined by the application that uses that library (something akin to C++
    extern
    function)? 2. Is it possible to have a
    fun main()
    , ie an entry point, in a shared library like you can in C++?
    d
    d
    s
    • 4
    • 19
  • y

    yuya_horita

    01/30/2019, 5:19 AM
    Kotlin/Native dependencies are downloaded every time I do
    gradle sync
    with gradle version 4.10.3 . Can I avoid that?
    g
    s
    n
    • 4
    • 9
  • m

    marchuck

    02/01/2019, 10:17 AM
    hello I am quite new to kotlin-native(I try android/ios) Could you recommend good DI framework?
    j
    y
    s
    • 4
    • 14
  • c

    charleskorn

    02/02/2019, 7:28 AM
    Is it possible to replace or disable kotlin-test if you want to use a different test framework? I’m trying to implement support for Spek on Kotlin/Native, but any test source set gets kotlin-test automatically. I’ve tried adding my own
    main()
    in the test source set but kotlin-native is still used
    o
    • 2
    • 5
  • s

    Simone Civetta

    02/03/2019, 12:59 PM
    Has anyone successfully managed to import
    os_log
    functions in iOS/macOS ? In ObjC it comes from a macro declared in
    iPhoneSimulator.sdk/usr/include/os/log.h
    but as such it doesn't seem to be visible in K/N
    o
    • 2
    • 4
  • y

    yuya_horita

    02/05/2019, 8:34 AM
    Are there any examples of testing
    isFrozen
    ?
    j
    • 2
    • 20
  • d

    Denis Shurygin

    02/05/2019, 3:37 PM
    Can't cal
    NSString.localizedStringWithFormat(myString, count)
    . I get following error:
    too many arguments for @ObjCMethod public external fun NSStringMeta.stringWithFormat(format: String): String defined in platform.Foundation
    . This is an a bug in K/N or I do something wrong?
    s
    • 2
    • 3
  • s

    spierce7

    02/07/2019, 5:57 AM
    @olonho Any idea when you guys are going to be willing to talk about some of the proposed changes to the memory model? My team is trying to write common code that will be compatible with Kotlin/native in the future, and are very interested in the potential changes.
    o
    d
    k
    • 4
    • 8
  • g

    gmaciel

    02/07/2019, 10:07 AM
    I'm testing a KN with a shared lib that's an external module but it doesn't compile saying it can't find the
    expected
    function. Do i need all this declarations in the same module for it to work? So all expect/declare functions will need to be wrapped into the common module? And then the project (Android/iOS) imports it?
    o
    • 2
    • 1
  • s

    Slackbot

    02/07/2019, 1:49 PM
    This message was deleted.
    t
    • 2
    • 2
  • r

    Roman

    02/07/2019, 2:23 PM
    Tell me please. I create a stream using  CreateThread (winapi), trying to call it GetForegroundWindow is also from winapi. But the program is cut down, and without errors. The same code, without a stream, works like a stream without this function. Tried to call the function "initRuntimeIfNeeded ()", did not help
    Thread.txt
    t
    • 2
    • 5
  • g

    gianluz

    02/07/2019, 4:51 PM
    I’m creating a command line tool, that need to be compatible for mac/win/linux machines, also, i’m using only posix as dependency and the code should be exactly the same, but in commonMain looks like i cannot use it! going through the internet, i can find so many different approaches like konan or kotlin-multiplatform any idea or useful links about that?
    j
    d
    r
    • 4
    • 7
  • d

    Dominaezzz

    02/07/2019, 8:27 PM
    Does building for release instead of debug hide the exit warning about memory leaks? (mingw and 1.3.20). My project only warns me about leaks in release mode.
    o
    • 2
    • 1
  • d

    DaveQ

    02/08/2019, 1:21 AM
    the error is "Could not find method framework()", which makes no sense, as it obviously exists when run from command line
    r
    o
    • 3
    • 4
  • n

    Nico Buescher

    02/08/2019, 3:52 AM
    hey all. Is there any way to configure a kotlin multiplatform project to build a c library from source (inside the project) with gradle in the cinterop step?
    r
    • 2
    • 3
  • d

    DaveQ

    02/08/2019, 7:18 AM
    ok, now I've got a simple kotlin-multiplatform target question. As you can see here, I'm using fromPreset(presets.iosX64) and seems to make two gradle tasks, 1) for an ios Framework and 2) for a klib. How do I re-write my gradle code to ONLY produce the Framework tasks?
    build_gradle.txt
    i
    • 2
    • 1
  • r

    Ryan Batchelder

    02/08/2019, 12:40 PM
    Hey all, I have a question about KN dependencies. I have a klib that's built only for Linux. Is there a way to have CLion pull sources when I pull it in as a dependency so that I can get highlighting/completion/etc while I develop against it on a Mac? Or would I need to publish a klib for Mac as well?
    n
    o
    • 3
    • 4
Powered by Linen
Title
r

Ryan Batchelder

02/08/2019, 12:40 PM
Hey all, I have a question about KN dependencies. I have a klib that's built only for Linux. Is there a way to have CLion pull sources when I pull it in as a dependency so that I can get highlighting/completion/etc while I develop against it on a Mac? Or would I need to publish a klib for Mac as well?
n

nestserau

02/08/2019, 1:44 PM
Your sources are in the
java-source
artifact, not in
klib
.
o

olonho

02/08/2019, 1:47 PM
You do not need sources to get completion, klib is enough
r

Ryan Batchelder

02/08/2019, 3:25 PM
Right, okay, it looks like the problem that I was having was that the project that was importing the klib was configured for a mac target, even though it should have been a linux target (still writing on Mac, but building in Docker). Now my dependency completion is working, but platform calls aren’t (which I suppose is expected).
o

olonho

02/09/2019, 5:08 PM
with upcoming 1.3.30 release or current master you could build for Linux on macOS/Windows hosts
View count: 2