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
multiplatform
  • j

    John O'Reilly

    12/10/2021, 9:29 AM
    Should it be possible to try out new Kotlin Native memory model on an M1 device? The specific Ktor/Kotlinx Coroutines that seem to be required to use it don't support M1 right now I believe....not sure if there are later versions that do?
    👀 2
    h
    • 2
    • 9
  • k

    kevindmoore

    12/10/2021, 9:51 PM
    AppCode?
    s
    k
    • 3
    • 5
  • u

    ursus

    12/11/2021, 4:30 AM
    I'd like to share whole feature with ios app, Feature uses sqlite database, or rather adds table to the schema. I use sqldelight for that. Now, if the native sqlite driver uses the same database name, then it should add feature's tables to the existing database the ios app already used, right? However, is this safe in terms of threads, locks etc at runtime? Doesn't feel like it. There should probably be only one database connection. However I dont want to create a separate db, that wont scale well etc.
    k
    • 2
    • 7
  • r

    Ruben Quadros

    12/11/2021, 4:21 PM
    Hi guys, what kind of crash analytics setup do you have in your KMM apps?
    k
    • 2
    • 1
  • s

    salomonbrys

    12/13/2021, 4:12 PM
    Hey guys, I’ve added a Gradle Shared Cache on my Kotlin/Multiplatform app. All
    compileKotlinJs
    tasks always report a Cache MISS, and every JS is always recompiled. All other compilation tasks do hit the cache, it’s only JS compilation that always misses. Anyone knows what’s going on ?
    • 1
    • 1
  • r

    Radoslaw Juszczyk

    12/13/2021, 6:59 PM
    Hello, What is
    runCommonizer
    task about? I just came back to my old multiplatform project (updated all deps) and this task takes forever (over 1h). Is there a way to make it run faster or disable it? Or configure the project the way that I dont need it? It takes that long on both macOS and windows11 platforms.
    r
    l
    • 3
    • 18
  • m

    Marcello Galhardo

    12/13/2021, 8:14 PM
    Out of curiosity: the official guidance around Gradle modules are kebap-case (2) but when you generate a new project with KMM plugin, it uses camel case (ie,
    androidApp
    ,
    iosApp
    and
    shared
    ). Any special reason for that? Should we use camel case to all “kotlin multiplatform modules” as a standard or only for the app modules?
    c
    d
    • 3
    • 2
  • e

    elect

    12/14/2021, 12:47 AM
    anyone is using (and got working)
    org.jetbrains.kotlinx.benchmark
    for the jvm only with a specific separate sourceSet?
    • 1
    • 1
  • r

    rsktash

    12/14/2021, 5:42 PM
    Hi why I’m getting this warning?
    f
    • 2
    • 2
  • a

    Amaan

    12/14/2021, 7:54 PM
    I want to create a Kotlin multiplatform library that contains a set of models and algorithms that I can then use in a React app and a Kotlin app. I used the basic template created by IntelliJ and make this simple repo: https://github.com/cloudyDino/ChessTournamentPairing After I run a
    ./gradlew build
    , I get output in the
    /build
    folder. However, how do I actually use the output in a Javascript app? How do I use it as a dependency for a separate Kotlin app? I tried publishing to MavenLocal but I keep getting a warning that gradle has failed to resolve the line I added
    implementation "com.cloudydino:ChessTournamentPairing:0.0.1"
    b
    • 2
    • 1
  • t

    tseisel

    12/15/2021, 10:26 AM
    Does anyone have issues with
    kotlin.mpp.enableGranularSourceSetsMetadata=true
    ? While my MPP library builds totally fine, it's wreaking havoc in my IDE (be it IntelliJ or Android Studio) : •
    public
    modifiers are labelled as redundant (but
    exlicitApi()
    it enabled, removing them fails the build) •
    commonMain
    sources may import declarations from
    java.*
    , which is illegal •
    expect
    declarations are marked as errors due to "Kotlin Multiplatform is an experimental feature" If I remove this config flag, I only have errors indicating that some
    expect
    declarations have no implementation in a given platform.
    k
    • 2
    • 3
  • n

    Nilay Dağdemir

    12/15/2021, 10:26 AM
    Hello all 👋 I need to use a function that I’ve declared in iosMain which takes varargs Any parameters, from my Swift code. Do you know how can I do it?
    a
    • 2
    • 4
  • o

    Osman Saral

    12/16/2021, 12:15 PM
    Can I export a common dependency to android? like
    val commonMain by getting {
        dependencies {
            api(Deps.kotlinxDateTime)
        }
    }
    or maybe
    val androidMain by getting {
        dependencies {
            api(Deps.kotlinxDateTime)
        }
    }
    And use kotlinx datetime from android? PS: I tried these but they didn't work.
    r
    m
    • 3
    • 9
  • n

    Nacho Ruiz Martin

    12/16/2021, 4:36 PM
    Hey! 👋 Has anyone tried using composite builds in gradle (
    includeBuild
    ) to have a separate standalone project for the KMM shared multimodule project? Everything is building correctly but IDE is showing errors with dependencies between modules of the KMM project.
    l
    m
    m
    • 4
    • 6
  • a

    Alexandre Brown

    12/17/2021, 3:47 PM
    Context : I have a root MPP module and many MPP sub modules. Is it possible to define the targets inside in the root module? Thanks
    r
    • 2
    • 2
  • a

    Alexandre Brown

    12/17/2021, 6:12 PM
    Hello, is it possible to reference an interface (that has no impl) in a kotlin MPP library commonMain from a different Java/Kotlin only Module? myJavaModule -> MPP Library/commonMain/MyInterface Thanks
    j
    b
    • 3
    • 62
  • s

    spierce7

    12/18/2021, 3:14 AM
    I’m getting the following gradle error output while compiling. I can’t figure out how to solve the error. Can someone help me figure out how to solve this?
    m
    • 2
    • 9
  • p

    ptsiogas

    12/18/2021, 11:12 AM
    Hello, Has anyone created a GitHub action/app for kotlinx-kover?
    j
    m
    • 3
    • 22
  • j

    Javier

    12/18/2021, 2:51 PM
    What is
    kotlin-js-store
    ? Recently it is being autogenerated in my projects that target JS
    h
    c
    +2
    • 5
    • 16
  • w

    Waqas Tahir

    12/18/2021, 4:30 PM
    Sqldelight creates a new database / erases previous data every time I restart the program (jvm , windows)
    k
    t
    • 3
    • 6
  • m

    Mendess

    12/18/2021, 5:05 PM
    is there anyway to get the current filename as a string? Something like C or pythons
    __FILE__
    magic constant
    e
    j
    d
    • 4
    • 12
  • d

    dimsuz

    12/18/2021, 8:20 PM
    I'm trying to port and publish my library to KMM and I have to tell you this is hell on earth experience. • Wanted to use atomics. Failed to set up kotlinx-atomicfu, it assumes configuration in root-module, but even after hacks it failed with exceptions • gradle-kts constantly breaks completion/compilation • gradle-kts has very weird rules as to what goes where, plugin repositories were in main file, now they're in settings.kts, convention plugins have weird rules on deps declaration etc etc Especially publishing configuration. • All examples are trivial and assume everything in the root module • Article from Kotlin's dev-rel assumes the same and plainly doesn't work • Libraries on github do not use kts (it seems) • I cannot create sourcesJar and no examples on how to do this in KMM setting • Reading every other section of KMM guide makes me believe that it's all full of a lots and lots of workarounds and hacks I'm sure all this can be solved, but as the beginner I'm very frustrated and tired of battling the tools. Been at it all day and got nowhere. Can't even publish to maven local.
    r
    y
    g
    • 4
    • 7
  • h

    Honey Sandy

    12/19/2021, 4:07 AM
    I have cocoapods installed on my mac. Then i run kmm project in android studio i always get Cannot run program “pod”java.io.IOException: error=2, No such file or directory How can i resolve this? Thanks!
    v
    d
    u
    • 4
    • 7
  • d

    dimsuz

    12/19/2021, 1:43 PM
    How can I list artifact dependencies when using KMM plugin? Running
    ./gradlew dependencies
    lists only dependencies of
    kotlinKlibCommonizerClasspath
    and it seems to be the only configuration in the project for some reason
    j
    • 2
    • 3
  • e

    Ethan Davidson

    12/19/2021, 4:45 PM
    Hi everyone! I'm trying to convert a Kotlin/JVM project to KMP, but can't figure out how to get the publishing to work. Would anyone be able to take a look at this PR and tell me what I'm doing wrong? https://github.com/notKamui/Keval/pull/29
    🤝 1
    d
    m
    • 3
    • 3
  • d

    dimsuz

    12/19/2021, 7:27 PM
    Yeah, it definetely feels like kmm + gradle is not a good match. Everytime I try to configure something build-related, it ends up leading into dozens of open tabs, google searches, swears and lost hopes 🙂 And this is after 9+ years of working with Android and gradle. I do hope that somehow I'll aquire more kmm+kts+gradle-fu, but I wish this was more friendly and welcoming ecosystem. P.S. And I didn't even try building my KMM project on iOS, I suspect this will be another "fun" ride :)
    🙌 1
    j
    n
    • 3
    • 6
  • r

    Rahul Rawat

    12/20/2021, 5:21 AM
    Can anyone please help with the following issue coming with sqldelight
    Execution failed for task ':compileSqlDriverNativeMainKotlinMetadata'
    w: library included more than once: /Users/rahulrawat/.konan/kotlin-native-prebuilt-macos-x86_64-1.5.31/klib/common/stdlib
    w: Could not find "co.touchlab:sqliter-driver-cinterop-sqlite3" in [/Users/rahulrawat/Desktop/Projects/kmp/AddressLibrary, /Users/rahulrawat/.konan/klib, /Users/rahulrawat/.konan/kotlin-native-prebuilt-macos-x86_64-1.5.31/klib/common, /Users/rahulrawat/.konan/kotlin-native-prebuilt-macos-x86_64-1.5.31/klib/platform/ios_arm64]
    Tried reverting to 1.5.2 of sqlDelight and kotlin 1.5 but nothing seems to be working.
    d
    a
    • 3
    • 3
  • m

    Marko Novakovic

    12/20/2021, 1:06 PM
    any sample/tutorial showing how to add Compose Multiplatform to existing Android Compose app?
    c
    • 2
    • 3
  • m

    MarkRS

    12/20/2021, 1:38 PM
    Can we access Swift classes from shared code, or is it just "foundation" classes, and what's the definition of those if that's the case? What I really want is Swift's Path class, but suppose I could settle for CGPath
    m
    k
    • 3
    • 3
  • m

    Marko Novakovic

    12/20/2021, 1:40 PM
    No such module 'shared'
    and can’t get project to build/run on iOS. how to fix it. if worked properly but since I imported some dependencies it won’t build
    k
    • 2
    • 3
Powered by Linen
Title
m

Marko Novakovic

12/20/2021, 1:40 PM
No such module 'shared'
and can’t get project to build/run on iOS. how to fix it. if worked properly but since I imported some dependencies it won’t build
k

kpgalligan

12/20/2021, 4:12 PM
If using cocoapods, there's a long standing issue where you need to
pod install
, try to run (and fail), then
pod install
again
m

Marko Novakovic

12/20/2021, 4:12 PM
not working…
but thanks
View count: 7