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

    fnasibov

    12/12/2018, 12:23 PM
    Hi, everyone. i wrote some kotlin app using cinterop ( tensorflow c api), in intellij. How can i configure debugger? LLDB, for example?
    j
    • 2
    • 1
  • a

    Alexander Suslov

    12/12/2018, 2:38 PM
    I use K/N in my Android/IOs project. Trying to migrate from
    konan
    to the new
    kotlin-multiplatform
    plugin. Is it possible to have MPP library in the MPP project? I created an MPP library using IDEA's wizard, published it in maven local and tried to add to the project. But I have a gradle sync error:
    More than one file was found with OS independent path 'META-INF/FooMppLib.kotlin_module'
    s
    s
    i
    • 4
    • 9
  • k

    kyonifer

    12/13/2018, 1:30 AM
    does k/n support the arm64_32 arch used on the AW series 4? seems to be a required arch when importing a k/n framework into an apple watch extension in xcode 10.
    s
    l
    o
    • 4
    • 3
  • n

    Nir Golan

    12/13/2018, 7:16 AM
    hi everyone, new to k/n i'm trying to open a new project in intellij idea and get this:
    Unable to find method 'sun.misc.Unsafe.defineClass(Ljava/lang/String;[BIILjava/lang/ClassLoader;Ljava/security/ProtectionDomain;)Ljava/lang/Class;'.
    Possible causes for this unexpected error include:<ul><li>Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
    Re-download dependencies and sync project (requires network)</li><li>The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
    Stop Gradle build processes (requires restart)</li><li>Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.</li></ul>In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.
    i'm on ubuntu 18.10, openJdk 11, latest IDEA, thanks
    o
    • 2
    • 2
  • d

    Dico

    12/13/2018, 12:58 PM
    If you want to pass a pointer, you can use
    memScope {
        val size = alloc<UIntVar>()
        sysctlbyname(..., ..., size.ptr,)
        size.value
    }
    n
    j
    • 3
    • 14
  • n

    nestserau

    12/13/2018, 3:04 PM
    A question about toll-free bridging in iOS. For example when I call
    CFBundleGetValueForInfoDictionaryKey
    I get an object of type
    CFTypeRef?
    , but it’s bridged to
    NSString *
    automatically in Objective C. How do I get a Kotlin string out of
    CFTypeRef?
    ?
    s
    • 2
    • 2
  • d

    davidasync

    12/13/2018, 3:39 PM
    will kotlin-native replace kotlin-jvm ?
    🇳🇴 10
    t
    • 2
    • 1
  • c

    coletz

    12/13/2018, 6:38 PM
    hey guys, I'm totally new to kotlin/native, but I need it for a multiplatform project. Is there any way to convert a ByteArray to a platform.Foundation.NSData?
    j
    d
    s
    • 4
    • 8
  • l

    loganj

    12/13/2018, 11:14 PM
    question about linking: I have a little (multiplatform) project that builds an iOS framework. That framework has all the kotlin-native stuff linked in (ie the stdlib). I was hoping to make this a multi-module project and build lots of little frameworks. If I do will they all necessarily get their own copy of the stdlib? Is that avoidable in any reasonable way?
    r
    i
    s
    • 4
    • 6
  • l

    loganj

    12/13/2018, 11:15 PM
    ie, I don’t necessarily want all my frameworks to be self-contained, happy to pull the stdlib etc into my consuming projects as a separate framework
    o
    • 2
    • 2
  • s

    spierce7

    12/14/2018, 4:39 AM
    When will compile speed / incremental compilation be a focus for kotlin/native?
    o
    t
    m
    • 4
    • 4
  • g

    goncalossilva

    12/14/2018, 6:16 AM
    I'm having a hard time understanding how to implement `getline`'s sample in K/N: https://linux.die.net/man/3/getline (at the bottom)
    g
    o
    • 3
    • 6
  • l

    loganj

    12/14/2018, 6:25 PM
    this may be more of a gradle question, but what’s the right way to define a framework module that rolls up a couple of library modules? source set dependency doesn’t seem right (and isn’t working)
    k
    s
    i
    • 4
    • 27
  • l

    loganj

    12/14/2018, 6:26 PM
    (this is a framework with no source code of its own, it should just be aggregating other modules together for packaging)
    o
    • 2
    • 1
  • j

    Jared Woolston

    12/15/2018, 5:15 AM
    I am working on coming up with a non-trivial sample for kotlin on the STM32F4 Discovery board with Zephyr and have encountered a rather interesting issue. Specifically, this code generates a Usage fault in the ARM core of type No Co-processor instructions on line 8 (I presume line 8 because the message on line 7 shows in the console but line 8 does not). I am trying to determine why the build would even generate co-processor instructions in the first place for something like this. As a first pass i modified the konan plugin options to have the additional option
    -mfloat-abi=soft
    to ensure that any hardware FPU instructions would not be generated but this did not change the outcome. I am trying to track down what the reason for this on such a simple set of code and would be appreciative of anyone who can give me some more insight into the where I can look in konan or its various configuration/native files to perhaps gain more insight.
    Untitled.kt
    o
    k
    x
    • 4
    • 4
  • s

    spierce7

    12/15/2018, 6:25 AM
    Why is the Kotlin/native AppCode plugin not supported in the latest version of AppCode?
    o
    g
    • 3
    • 4
  • m

    Matej Kormuth

    12/15/2018, 5:43 PM
    How can I create String from UTF8 bytes? I found this function
    CreateStringFromUtf8
    in sources, but I cannot find kotlin function to call it. https://github.com/JetBrains/kotlin-native/blob/4f9cea4ee235b0663b9fb5660e814a49d06b69ed/runtime/src/main/cpp/KString.cpp#L710
    o
    • 2
    • 2
  • h

    Hunter Breathat

    12/15/2018, 10:49 PM
    Hey does anyone know if TornadoFx works with native?
    d
    • 2
    • 2
  • j

    Jared Woolston

    12/16/2018, 4:33 AM
    Does anyone know why konan is configured to use the
    target-sysroot-2-wasm
    sysroot for the STM32F4 target?
    😕 1
    m
    o
    k
    • 4
    • 7
  • s

    Strum355

    12/16/2018, 11:51 AM
    Quick question: does kotlin/native still allocate all objects on the heap or does it take more of a stack based approach like in languages such as Go and only escape to the heap if necessary?
    d
    • 2
    • 3
  • d

    darkmoon_uk

    12/16/2018, 1:24 PM
    Why have they created a new language construct for this?
    g
    r
    • 3
    • 7
  • j

    Jared Woolston

    12/16/2018, 6:09 PM
    Im trying to continue my efforts in getting kotlin floating point working in Zepyhr/STM32F4 and I think my last major hurtle is getting kotlin to compile with the same floating point options as zephyr. I added
    -mfpu=fpv4-sp-d16 -mfloat-abi=hard -march=armv7e-m
    to
    konan/platforms/zephyr/stm32f4_disco
    but am still getting a link error of
    arm-none-eabi/bin/ld: error: zephyr/zephyr_prebuilt.elf uses VFP register arguments, libapp.a(program.o) does not
    /home/jared/.konan/dependencies/gcc-arm-none-eabi-7-2017-q4-major-linux/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld: failed to merge target specific data of file libapp.a(program.o)
    which suggests to me that the object file being built by konanc is not being built with the correct flags going to gcc. Am I missing something in configuring the build to pass these flags?
    d
    • 2
    • 2
  • u

    unixer

    12/17/2018, 1:47 AM
    hi everybody
    l
    • 2
    • 5
  • u

    unixer

    12/17/2018, 1:48 AM
    I have some question about the iOS part
    y
    • 2
    • 30
  • l

    Landerl Young

    12/17/2018, 11:10 AM
    Hi guys, I’m working at Tencent (one of the largest IT company in China). We are going to develop a commercial SDK for Android and iOS, we want to facilitate code sharing by K/N. One thing concerns us is when will K/N be stable. 🎉
    g
    • 2
    • 1
  • n

    nestserau

    12/17/2018, 11:30 AM
    I’m trying to use HttpClient in a multi-platfrom project. When I run an iOS test via Gradle, I get this in the console:
    NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9807)
    I understand that I need to add
    NSAllowsArbitraryLoads
    into the Info.plist. But how do I do it with Kotlin? There is no
    Info.plist
    .
    s
    i
    • 3
    • 9
  • u

    unixer

    12/17/2018, 12:41 PM
    do you need to install Xcode on Mac?
    n
    • 2
    • 3
  • u

    unixer

    12/18/2018, 1:14 PM
    does anybody try the ios part of https://kotlinlang.org/docs/tutorials/native/mpp-ios-android.html#creating-ios-application ?
    t
    g
    • 3
    • 4
  • m

    Matej Kormuth

    12/18/2018, 11:03 PM
    Is it just me, or the kotlin stack traces do not include the line numbers? Is there any way to have the line numbers in stack traces?
    kotlin.AssertionError: Expected <108>, actual <107>.
            at kfun:kotlin.Throwable.<init>(kotlin.String?)kotlin.Throwable (0000000000440470)
            at kfun:kotlin.Error.<init>(kotlin.String?)kotlin.Error (0000000000442030)
    ...
    d
    l
    +3
    • 6
    • 8
  • i

    Ivan

    12/19/2018, 6:12 PM
    is there a way to use syncronized block in native? ios. there is no @syncronized available
    o
    • 2
    • 2
Powered by Linen
Title
i

Ivan

12/19/2018, 6:12 PM
is there a way to use syncronized block in native? ios. there is no @syncronized available
o

olonho

12/19/2018, 6:41 PM
what kind of problem you’re trying to solve? K/N concurrency module ensures that there’s no need for synchronized block if manipulating with Kotlin objects
i

Ivan

12/20/2018, 10:14 AM
@olonho just trying to syncronize stuff over some locked object. I havent tested if I really need that
View count: 5