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

    natario1

    05/15/2020, 12:17 AM
    After upgrading from 1.3.71 to 1.3.72, I get this warning:
    The Kotlin/Native distribution used in this build does not provide the standard library.
    And soon after, this error which crashes the whole gradle VM:
    e: Could not find "stdlib" in [/Users/natario/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].
    Does anyone know what this means? I can't see anything relevant in the changelog.
    a
    l
    • 3
    • 8
  • p

    Patrick

    05/15/2020, 10:38 AM
    I am trying to export my Kotlin Native Multiplatform project as a shared lib, but I am getting these error messages:
    > Task :windows-framework:linkDebugSharedWindows
    Produced library API in nimmstaWindows_api.h
    e: Compilation failed: The C:\Users\Patrick\.konan\dependencies\msys2-mingw-w64-x86_64-clang-llvm-lld-compiler_rt-8.0.1/bin/clang++ command returned non-zero exit code: 1.
    output:
    C:\Users\Patrick\AppData\Local\Temp\konan_temp6770444008327035466\api.cpp:355:9: error: unknown type name 'nimmstaWindows_kref_com_soywiz_klock_DateTime'; did you mean 'nimmstaWindows_kref_com_soywiz_korio_file_VfsFile'?
            nimmstaWindows_kref_com_soywiz_klock_DateTime (*get_dateCreated)(nimmstaWindows_kref_WinNimBuildInfo thiz);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            nimmstaWindows_kref_com_soywiz_korio_file_VfsFile
    C:\Users\Patrick\AppData\Local\Temp\konan_temp6770444008327035466\api.cpp:242:3: note: 'nimmstaWindows_kref_com_soywiz_korio_file_VfsFile' declared here
    } nimmstaWindows_kref_com_soywiz_korio_file_VfsFile;
      ^
    C:\Users\Patrick\AppData\Local\Temp\konan_temp6770444008327035466\api.cpp:1061:8: error: unknown type name 'nimmstaWindows_kref_com_soywiz_klock_DateTime'; did you mean 'nimmstaWindows_kref_com_soywiz_korio_file_VfsFile'?
    static nimmstaWindows_kref_com_soywiz_klock_DateTime _konan_function_9_impl(nimmstaWindows_kref_WinNimBuildInfo arg0) {
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           nimmstaWindows_kref_com_soywiz_korio_file_VfsFile
    C:\Users\Patrick\AppData\Local\Temp\konan_temp6770444008327035466\api.cpp:242:3: note: 'nimmstaWindows_kref_com_soywiz_korio_file_VfsFile' declared here
    } nimmstaWindows_kref_com_soywiz_korio_file_VfsFile;
      ^
    C:\Users\Patrick\AppData\Local\Temp\konan_temp6770444008327035466\api.cpp:1067:12: error: unknown type name 'nimmstaWindows_kref_com_soywiz_klock_DateTime'; did you mean 'nimmstaWindows_kref_com_soywiz_korio_file_VfsFile'?
      return ((nimmstaWindows_kref_com_soywiz_klock_DateTime){ .pinned = CreateStablePointer(result)});
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
               nimmstaWindows_kref_com_soywiz_korio_file_VfsFile
    C:\Users\Patrick\AppData\Local\Temp\konan_temp6770444008327035466\api.cpp:242:3: note: 'nimmstaWindows_kref_com_soywiz_korio_file_VfsFile' declared here
    } nimmstaWindows_kref_com_soywiz_korio_file_VfsFile;
      ^
    3 errors generated.
    Any ideas what I need to change? Those are all library classes.
    a
    • 2
    • 16
  • a

    aleksey.tomin

    05/15/2020, 12:21 PM
    How I can setup parameters for MacOS App Sandbox? I have to set
    com.apple.security.network.client
    to
    true
    https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_network_client
    a
    • 2
    • 1
  • s

    Sourabh Rawat

    05/16/2020, 2:26 PM
    I cant seem to import
    Char.isLetter()
    in my common code for multiplatform project. Any help ?
    r
    • 2
    • 1
  • s

    Sourabh Rawat

    05/16/2020, 4:31 PM
    how can i use C functions in stdio such as
    getchar()
    from KN ?
    • 1
    • 1
  • r

    Rahul Singhal

    05/17/2020, 9:32 AM
    How to determine which is better…..Lazy variable vs function with some return type…….. in kotlin. As we can use them interchangeably.
    s
    s
    h
    • 4
    • 7
  • s

    Samyak Jain

    05/17/2020, 7:03 PM
    Hi, can someone link me up with the upstream tar-file of Kotlin v-1.3.30 I fail to find it.
    a
    • 2
    • 1
  • a

    aleksey.tomin

    05/18/2020, 5:54 AM
    Hi, I’m trying to use CUrl https://github.com/JetBrains/kotlin-native/blob/master/samples/libcurl/src/libcurlMain/kotlin/CUrl.kt for POST data I’ve added SSL
    curl_easy_setopt(curl, CURLOPT_PORT, 443L)
    curl_easy_setopt(curl, CURLOPT_PROTOCOLS, CURLPROTO_HTTPS)
    and method POST
    fun post(postData: String) {
        curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headersCRef)
        val cstr = postData.cstr
        curl_easy_setopt(curl, CURLOPT_POST, 1)
        curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
        curl_easy_setopt(curl, CURLOPT_POSTFIELDS, cstr)
        curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, cstr.size)
        val res = curl_easy_perform(curl)
        curl_slist_free_all(headersCRef)
        if (res != CURLE_OK) {
            throw RuntimeException("curl_easy_perform() failed: ${curl_easy_strerror(res)?.toKString()}")
        }
    }
    But the server accepts wrong data - without some chars (at the start or at the end). What I do wrong? How it can be fixed? FIXED:
    curl_easy_setopt(curl, CURLOPT_POSTFIELDS, cstr)
    ->
    _curl_easy_setopt_(curl, _CURLOPT_POSTFIELDS_, cstr.getPointer(MemScope()))
    n
    v
    • 3
    • 5
  • v

    vsazel

    05/18/2020, 10:03 AM
    Hi, I'm trying to use KN with ncurses. Is there a way to debug an application from Idea and use a full-fledged terminal? It's not working without terminal obviously.
    e
    n
    • 3
    • 7
  • c

    Christian Sousa

    05/18/2020, 11:26 AM
    Any way of getting this to work on kotlin native? For example in Swift I can do:
    let label = UIView()
    label.frame.origin.x = ...
    I cant seem to find where I can update the
    x
    in kotlin..
    a
    • 2
    • 2
  • s

    saket

    05/18/2020, 6:10 PM
    When working with cinterop, is it expected that the generated klib and related build files will not be checked-in into vcs?
    m
    • 2
    • 2
  • j

    Jeff Beyond

    05/19/2020, 3:51 PM
    How config cmake in kotlin multiplatform project? When config as the following DSL in build.gradle
    android {
    
        defaultConfig {
            externalNativeBuild {
                cmake {
                    abiFilters  "arm64-v8a","armeabi-v7a"
                }
            }
        }
    
        externalNativeBuild {
            cmake {
                path 'CMakeLists.txt'
            }
        }
    }
    
    kotlin {
        macosX64(){
        }
        linuxX64() {
        }
    }
    I got an CONFIGURE FAILED error: ABIs [armeabi] are not supported for platform. Supported ABIs are [arm64-v8a, armeabi-v7a, x86, x86_64]. My project structure is shown in the attached image, How can I solve it?
    a
    k
    • 3
    • 9
  • s

    Slackbot

    05/20/2020, 3:47 AM
    This message was deleted.
    k
    • 2
    • 1
  • p

    phldavies

    05/20/2020, 3:07 PM
    Does anyone have any experience with using KMP to author a React Native module for iOS and Android?
    n
    s
    • 3
    • 2
  • k

    Kweku

    05/20/2020, 11:21 PM
    Is there anyway to ensure that unit ISN'T converted into void when exporting as framework for IOS? I've had an issue with higher order functions using Kotlin unit and where their meant to be passed into using void. E.G ((Type) -> Unit, (Type) -> Unit) -> Unit Where those functions would be passed into somewhere that takes (Type) -> Unit as a parameter, in the first part you Unit becomes KotlinUnit and in the 2nd it becomes Void making them incompatible
    a
    • 2
    • 2
  • a

    aleksey.tomin

    05/21/2020, 7:49 AM
    I tried to use
    ktor-client-core
    with
    ktor-client-curl
    (while
    ktor-client-cio
    isn’t redy). When I build the application I have the error
    cannot find -lcurl
    I’ve added
    libcurl.a
    and
    libcurl.dll.a
    into
    %HOMEPATH%\.konan\dependencies\curl\lib\
    but it isn’t helped. How can I fix it?
    a
    • 2
    • 7
  • u

    Ugi

    05/21/2020, 10:32 AM
    Hey, I have spotted this in my multiplatform project, but I guess it's konanc related. I'm using 1.4-M1 I am using
    UByteArray
    inline class in my project. linkDebugStaticLinux task fails (rather silently), but running konanc directly with parameters from the task provides the following output (this is just a snippet:
    /tmp/konan_temp4669369786604700434/api.cpp:249:216: error: unknown type name 'libmultiplatform_crypto_kref_kotlin_ByteArray'; did you mean 'libmultiplatform_crypto_kref_kotlin_Array'?
                      libmultiplatform_crypto_kref_kotlin_ByteArray (*digest_)(libmultiplatform_crypto_kref_com_ionspin_kotlin_crypto_hash_StatelessHash thiz, libmultiplatform_crypto_kref_kotlin_ByteArray inputMessage, libmultiplatform_crypto_kref_kotlin_ByteArray key, libmultiplatform_crypto_KInt hashLength);
                                                                                                                                                                                                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                           libmultiplatform_crypto_kref_kotlin_Array                                                             
    /tmp/konan_temp4669369786604700434/api.cpp:77:3: note: 'libmultiplatform_crypto_kref_kotlin_Array' declared here
    } libmultiplatform_crypto_kref_kotlin_Array;
    Indicating that
    libmultiplatform_crypto_kref_kotlin_ByteArray
    is unknown, which is somewhat correct because I am using UByteArray. I worked around this issue by simply declaring one ByteArray in the same class like this
    val byteArray: ByteArray = byteArrayOf(0, 1)
    And then compilation succeeded. My question is, is this a known bug, or should I report it?
    a
    • 2
    • 3
  • p

    Patrick

    05/22/2020, 11:06 AM
    Does anyone know why this code returns false?
    fun main() {
        val str = "123test123"
        val matches = Regex("""test""", RegexOption.MULTILINE).matches(str)
        println(matches)
    }
    p
    • 2
    • 2
  • p

    phldavies

    05/22/2020, 1:00 PM
    Has anyone had any luck obtaining the
    NSBundle
    for a K/N iOS Framework from within the framework? I’d like to use
    NSBundle.bundleForClass(ObjCClass)
    however this seems to return the Application bundle. If I call
    Bundle.init(for: ClassFromFramework.self)
    in Swift I get the right bundle.
    • 1
    • 1
  • i

    Imran/Malic

    05/22/2020, 1:26 PM
    Hi all, I am pretty new to Kotlin native. Is it possible to write hardware software with Kotlin native?
    a
    k
    n
    • 4
    • 10
  • k

    kpgalligan

    05/22/2020, 2:04 PM
    Building kotlin-native again. Master this time. Running into the following error.
    fatal error: module 'AutomaticAssessmentConfiguration' not found
    Wondering if anybody’s seen this.
    a
    • 2
    • 2
  • a

    Arkadii Ivanov

    05/22/2020, 10:37 PM
    Will there be a memory leak if both a Swift object and a Kotlin object have strong references to each other?
    s
    • 2
    • 1
  • n

    natario1

    05/24/2020, 9:44 PM
    Can anyone explain what
    kotlin.native.ImmutableBlob
    is and how to use it?
    d
    • 2
    • 4
  • s

    salomonbrys

    05/25/2020, 8:54 AM
    Hey guys. How do I say Kotlin/Native to link my cInterop library to link against the C++11 standard library ? I'm having a whole lot of
    undefined symbol: std::__cxx11::basic_string...
    error at linkage. My library is a C interface to some OpenCV features. I have
    libopencv-dev
    installed on my computer. Because my C wrapper transforms
    const char*
    into
    std::string
    , I can't compile my it with
    -D_GLIBCXX_USE_CXX11_ABI=0
    (then I get undefined symbol errors on all OpenCV method I use that takes a
    std::string
    because the ABI is different). The only solution I see is to download and re-compile OpenCV and all its dependencies with
    -D_GLIBCXX_USE_CXX11_ABI=0
    , which is an enormous hassle. Is there a way to instruct the Kotlin/Native linker to link against the C++11 standard library ?
    n
    m
    n
    • 4
    • 16
  • a

    aleksey.tomin

    05/26/2020, 5:56 AM
    How can I call Windows api such
    GetVersion
    ,
    GetSerialNumber
    ? I have not found these functions.
    a
    r
    • 3
    • 8
  • d

    delblanco

    05/26/2020, 1:00 PM
    Is there a known issue that
    ensureNeverFrozen()
    does not generate an exception or not caught on ios?
    a
    k
    p
    • 4
    • 24
  • p

    Patrick

    05/26/2020, 3:19 PM
    When exporting my project as a dynamic library I have this line in my header file:
    typedef float __attribute__ ((__vector_size__ (16))) nimmstaWindows_KVector128;
    This is not valid code. Any idea how to fix this other than to manually delete it?
    m
    • 2
    • 6
  • c

    Christian Sousa

    05/27/2020, 4:27 PM
    Anyone had any luck subclassing UICollectionView? I’m having trouble making it have the height of its content size. Already tried so much stuff that I don’t really know what I could do more.
    s
    • 2
    • 3
  • a

    Ananiya

    05/27/2020, 6:44 PM
    hi i was making chatbot with https://www.api.ai/ and test it in intellij idea and it works fine and i want to deploy it in microcontroller (arduino, rasberrypi, BeagleBone, Sharks Cove, Minnowboard MAX, Nanode, android things ..............) but i don`t know which microcontroller is compatible with kotlin . which is ? 🤔
    d
    • 2
    • 1
  • s

    Samyak Jain

    05/28/2020, 10:42 AM
    Do we have a single kotlinx library which consists of all the kotlinx.* ?
    r
    • 2
    • 1
Powered by Linen
Title
s

Samyak Jain

05/28/2020, 10:42 AM
Do we have a single kotlinx library which consists of all the kotlinx.* ?
r

ribesg

05/28/2020, 11:18 AM
No. That would not make sense
💯 1
View count: 8