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

    phldavies

    07/20/2020, 4:31 PM
    Has anyone had any luck consuming a pod through cocoapodsext? I’m attempting to use
    TensorFlowLiteC
    and/or
    TensorFlowLiteObjC
    from my
    iosMain
    but when I build in XCode it always complains about undefined symbols when linking. For example, adding
    pod("TensorFlowLiteC")
    to the KaMPKit Starter and adding
    println(TfLiteVersion().toKString())
    to the
    initKoin {}
    block in
    KoiniOS.kt
    results in
    Showing All Messages
    Undefined symbols for architecture x86_64:
    
      "_TfLiteVersion", referenced from:
    
          _cocoapods_TensorFlowLiteC_TfLiteVersion_wrapper17 in result.o
    
    ld: symbol(s) not found for architecture x86_64
    when building in XCode (from the gradle output) I’m stumped as to what to look into next.
    r
    p
    • 3
    • 14
  • m

    Marko Mitic

    07/20/2020, 5:25 PM
    It's happening https://blog.jetbrains.com/kotlin/2020/07/kotlin-native-memory-management-roadmap/
    🎉 11
    k
    j
    +6
    • 9
    • 37
  • j

    João Gonçalves

    07/20/2020, 11:00 PM
    What are the current approaches that one can use to generate a .framework, from kotlin/native, and distribute it to be consumed by third party iOS developers (with objc/swift)? Is the podspec, generated by the cocoapods plugin, a good fit for this scenario? Or would it be better to have an xcode project whose sole purpose is to generate the final .framework, assuming that it will be built entirely with kotlin?
    k
    t
    +2
    • 5
    • 32
  • s

    serebit

    07/21/2020, 9:20 PM
    Any plans for a RISC-V target?
    n
    • 2
    • 3
  • s

    salomonbrys

    07/22/2020, 8:04 AM
    Hey guys, I'm trying to implement a TCP connection on iOS using Network.framework. To open a simple TCP connection, I'm supposed to call:
    nw_parameters_create_secure_tcp(
        NW_PARAMETERS_DISABLE_PROTOCOL,      // No TLS
        NW_PARAMETERS_DEFAULT_CONFIGURATION  // Default TCP config
    )
    However, iOS gives me a very weird error:
    _nw_parameters_configure_protocol_disable_block_invoke _nw_parameters_configure_protocol_disable called directly, dumping backtrace:
    [x86_64] libnetcore-1880.120.4
        0   libnetwork.dylib                    0x00007fff5118d1f8 __nw_create_backtrace_string + 120
        1   libnetwork.dylib                    0x00007fff5100a898 _nw_parameters_configure_protocol_disable_block_invoke + 120
        2   PhoenixShared                       0x00000001099af1b5 _70686f656e69783a70686f656e69782d736861726564_knbridge41 + 37
        3   PhoenixShared                       0x0000000109972eac kfun:fr.acinq.phoenix.io.BlockFunctionImpl16.invoke#internal + 220
        4   PhoenixShared                       0x0000000109972fbf kfun:fr.acinq.phoenix.io.BlockFunctionImpl16.$<bridge-UNNN>invoke(platform.darwin.NSObject?){}#internal + 95
        5   PhoenixShared                       0x000000010997342b _70686f656e69783a70686f656e69782d736861726564_knbridge47 + 251
        6   libnetwork.dylib                    0x00007fff5100d7b6 nw_parameters_create_secure_tcp + 342
    ...
    Anyone knows what the frack ?
    • 1
    • 1
  • n

    natario1

    07/23/2020, 11:17 AM
    My cinterop task fails with:
    e: Could not find "library" in [/Users/natario/Projects/project/project-name, /Users/natario/.konan/klib, /Users/natario/.konan/kotlin-native-macos-1.3.72/klib/common, /Users/natario/.konan/kotlin-native-macos-1.3.72/klib/platform/android_arm64].
    But nothing I have is called "library", does anyone have any hints? If I run the task with --info I can see the command that is failing (it's huge, but this should be the core part...
    ...kotlin-native.jar org.jetbrains.kotlin.cli.utilities.MainKt cinterop -o...
    ). None of the arguments to this is called "library", I just see some
    -library <http://path.to|path.to>.klib
    which are the libraries that are being cinterop-ed.
    a
    • 2
    • 10
  • e

    Elka

    07/24/2020, 11:44 AM
    Unable to run on armv7 (iOS9). Works fine on arm64 devices. Getting this error
    dyld: Library not loaded: /usr/lib/libate.dylib
      Referenced from: /private/var/containers/Bundle/Application/59E0AF1E-EF30-4E00-8C12-C85768FA992A/Example.app/Frameworks/Core.framework/Core
      Reason: image not found
    The Kotlin framework is a FAT framework. (targets arm32 and arm64)
    r
    m
    • 3
    • 6
  • s

    spierce7

    07/24/2020, 7:34 PM
    Will the concurrency limitations will be lifted in the current ARC style memory manager, or will we not get java-style concurrency until the new memory model comes out?
    r
    k
    • 3
    • 5
  • b

    Big Chungus

    07/24/2020, 8:37 PM
    Are there any plans for K/N to support python interop? Or maybe it's already possible? Just wondering as it'd open up kotlin to data science
    n
    • 2
    • 3
  • c

    caffeine

    07/24/2020, 9:27 PM
    Hello. I write kotlin library for sqlite. I want to build sqlite from source before build kotlin native part of library. How can I get access to konan gcc path? Current path for current build target.
    s
    d
    • 3
    • 4
  • b

    Big Chungus

    07/25/2020, 10:43 AM
    How can i safely pass long from c to kotlin as int ir int array and then safely convert it back to long on kotlin?
    c
    • 2
    • 3
  • b

    Big Chungus

    07/27/2020, 1:07 AM
    Any way to compare two lambdas to determine if they're equal (when they have been constructed separately with the same builder)
    p
    p
    • 3
    • 3
  • r

    raniejade

    07/28/2020, 7:55 AM
    So with KN
    1.4.0-rc
    , the compilation of our project after a single line change has significantly increased, from 30-40secs in
    1.3.71
    and to
    3mins+
    in
    1.4.0-rc
    . It looks like it's doing a full build every time.. Does anyone have the same experience?
    e
    • 2
    • 7
  • m

    msink

    07/28/2020, 11:25 AM
    Is it known regression in cinterop?
    libui
    have opaque pointers, say
    typedef struct uiArea uiArea;
    Previously it was impored as
    typealias uiArea = CPointed
    And now (in 1.4.0-rc) it is just missed in output of
    klib contents ...
    , and so not available by Ctrl-B in IDEA, and inspection by F2 complains "Cannot resolve symbol 'uiArea'".
    d
    d
    • 3
    • 7
  • j

    Jurriaan Mous

    07/29/2020, 9:56 AM
    Can somebody see what makes my cinterop setup break since 1.4-M3? It is still broken for all targets in 1.4.0-rc. It fails with:
    Exception in thread "main" java.nio.file.NoSuchFileException: libobjectiveRocks-macOS.a
    	at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
    	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
    	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
    	at sun.nio.fs.UnixCopyFile.copy(UnixCopyFile.java:526)
    	at sun.nio.fs.UnixFileSystemProvider.copy(UnixFileSystemProvider.java:253)
    	at java.nio.file.Files.copy(Files.java:1274)
    	at org.jetbrains.kotlin.konan.file.File.copyTo(File.kt:64)
    Build.gradle: https://github.com/marykdb/rocksdb-multiplatform/blob/kotlin-1.4/build.gradle.kts Cinterop file (MacOS) https://github.com/marykdb/rocksdb-multiplatform/blob/kotlin-1.4/src/nativeInterop/cinterop/rocksdbMacOS.def I already opened a Youtrack issue over a week ago but had no answer. Would love to try the release candidate on my main project but this is holding me back. https://youtrack.jetbrains.com/issue/KT-40508
    👍 1
    n
    a
    • 3
    • 4
  • n

    Nick

    07/29/2020, 1:35 PM
    I’m using the cocoapods gradle plugin, 1.4.0-rc. I took the kotlin-with-cocapods-sample library, added in my own source code and podspec file. When I sync the project, the build fails when
    xcodebuild -project Pods.xcodeproj -scheme Boulangerie-iOS -sdk iphoneos -configuration Release
    is executed. It’s not finding all the header files. Error: “fatal error: ‘com/dough/profitability/calculation/Zoner.h’ file not found”. Relevant part of the podspec:
    s.preserve_paths = "ios/src"
      s.header_mappings_dir = "ios/src/objc"
      s.public_header_files = "ios/src/objc/**/*.h"
      s.source_files  = "ios/src/objc/**/*.{h,m}"
      s.resources = 'ios/src/resources/**/*'
    
      s.dependency 'J2Objc', '~> 2.6' 
      s.dependency 'AFNetworking', '~> 4.0.1'
    
      s.xcconfig = {
          'HEADER_SEARCH_PATHS' => '"${PODS_ROOT}/Headers/Private/Boulangerie-iOS"/**'
      }
    Anyone know how I can get this to work?
    s
    • 2
    • 6
  • v

    Victor Grigorev

    07/29/2020, 1:51 PM
    Hi everyone! Does someone know how to increase build time for real iPhone. Now my build takes about 10 minutes and it's so slow.
    n
    • 2
    • 1
  • b

    Big Chungus

    07/29/2020, 4:20 PM
    Is it possible to publish sources for native targets? Something like x-sources.jar for IDEA to pick up
    r
    • 2
    • 2
  • j

    Justin

    07/29/2020, 9:39 PM
    Cross-posting here: https://kotlinlang.slack.com/archives/C0KLZSCHF/p1596049446156000
    a
    • 2
    • 2
  • a

    Ardian

    07/30/2020, 5:09 AM
    Hi all! I'm just starting to play around with Kotlin Native for a command line utility tool. I'm trying to figure out how to make a
    fork
    system call but I don't think the
    fork
    function is available. However, I see it being mentioned in the below SO posts. Is there something I'm missing? https://stackoverflow.com/questions/57190228/using-kotlin-native-how-can-i-execute-an-external-os-executable-or-path-comman https://stackoverflow.com/questions/51460921/kotlin-native-execute-an-executable
    a
    n
    • 3
    • 8
  • a

    aleksey.tomin

    07/30/2020, 8:36 AM
    I try to use fopen function in mingw. When fileName is ANSI string it works. But when fileName contains non-ansi symbols (cyrillic etc) I have a problem -
    can't open file
    For C I've found the solution -
    OemToCharA
    function but it doesn't work for me
    fileName = memScoped {
                val bytes = allocArray<CHARVar>(aFileName.length * 2)
                OemToCharA(aFileName, bytes)
                bytes.toKString()
            }
    fileName contains wrong chars
    p
    • 2
    • 1
  • a

    antrax

    07/31/2020, 8:51 AM
    Sounds like subclasses of NSObject are automatically frozen:
    class TestNsObj: NSObject() {
        init {
            println("is frozen: $isFrozen")
        }
    }
    
    fun runTest() {
        val a = TestNsObj()
    }
    output: is frozen: true Couldn't find any official info about that. Do I miss smth? Btw if I remove subclassing from NSObject the object is not frozen.
    a
    • 2
    • 2
  • p

    Paul Woitaschek

    07/31/2020, 9:29 AM
    It seems the mpp plugin publishes 3 different maven artifacts. Why is that and on which one should I depend in my application?
    b
    n
    • 3
    • 3
  • n

    Nico Buescher

    07/31/2020, 10:00 PM
    I’m working on testing the 1.4.0-RC for a library, and I’m getting:
    e: Could not find "posix" in [/Users/[user]/Developer/IdeaProjects/kgl/kgl-glfw, /Users/[user]/.konan/klib, /Users/[user]/.konan/kotlin-native-prebuilt-macos-1.4-rc1-40/klib/common, /Users/[user]/.konan/kotlin-native-prebuilt-macos-1.4-rc1-40/klib/platform/macos_x64].
    I checked in the klib directory, and in 1.3.72 there is a “posix” folder inside
    ~/.konan/kotlin-native-macos-1.3.72/klib/platform
    , and in 1.4.0-RC, that folder is called “org.jetbrains.kotlin.native.platform.posix”. Anyone know what’s going on there? I’m working with the new hierarchical mpp setup if that makes a difference
    s
    • 2
    • 4
  • b

    Big Chungus

    08/01/2020, 10:20 AM
    How to get currentTimeMillis on K/N?
    a
    e
    • 3
    • 5
  • b

    Big Chungus

    08/01/2020, 10:41 AM
    Is there a gradle command to refresh sourceSet dependencies with
    kotlin.mpp.enableGranularSourceSetsMetadata=true
    s
    • 2
    • 1
  • b

    Big Chungus

    08/02/2020, 8:05 AM
    Could someone with mac or Windows kindly check if this kotlinx-html expansion resolves on their native projects targeting said platforms?
    a
    • 2
    • 1
  • s

    serebit

    08/04/2020, 5:16 PM
    Is there a way to prevent the dependency tarballs in the
    .konan/cache
    directory from being deleted, like a Gradle property of some sort? This is for CI, where caching the tarballs directly and unpacking them each time would be optimal.
    s
    • 2
    • 9
  • r

    Romain Dubreucq

    08/05/2020, 5:14 PM
    Hello, is it possible to use two Kotlin/Native frameworks in a single iOS application?
    j
    k
    j
    • 4
    • 6
  • o

    Omar Mainegra

    08/05/2020, 6:44 PM
    Hi there, I'm trying to do some network request with
    NSURLSession
    in a test, but it keeps failing for every host I tested with
    The certificate for this server is invalid.
    I came across this thread, but it looks a bit outdated and it didn't work for me https://kotlinlang.slack.com/archives/C3SGXARS6/p1545046248234300
    s
    • 2
    • 1
Powered by Linen
Title
o

Omar Mainegra

08/05/2020, 6:44 PM
Hi there, I'm trying to do some network request with
NSURLSession
in a test, but it keeps failing for every host I tested with
The certificate for this server is invalid.
I came across this thread, but it looks a bit outdated and it didn't work for me https://kotlinlang.slack.com/archives/C3SGXARS6/p1545046248234300
s

svyatoslav.scherbina

08/07/2020, 8:47 AM
Hi. This might be relevant: https://youtrack.jetbrains.com/issue/KT-38317
View count: 5