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

    AnaR

    05/02/2022, 6:53 PM
    I started using Kermit for logging for a KMM library. It works really well on my machine on iOS emulator (x64 target). I am able to configure, log, provide a mock logger for testing and use it with Koin on both Android and iOS emulator. However, the release build is failing saying it cannot find kermit-koin 1.1.1 for iosArm64. Wondering if there is something missing from the published library?
    k
    • 2
    • 2
  • m

    Mohit Sharma

    05/03/2022, 8:25 AM
    Has anyone encountered this issue - “_CoreSimulator.framework was changed while the process was running. This is not a supported configuration and can occur if Xcode.app was updated while the process was running. Service version (802.6) does not match expected service version (783.5)._” ?
    • 1
    • 1
  • m

    Mendess

    05/03/2022, 11:09 AM
    how do I make gradle generate typescript from my multiplatform library? I've been searching for this for a while and I can't figure it out 😔 I have a js target
    kotlin {
        /* Targets configuration omitted.
        *  To find out how to configure the targets, please follow the link:
        *  <https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#setting-up-targets> */
    
        jvm()
        js(IR) {
            browser {
                testTask {
                    useKarma {
                        useFirefox()
                    }
                }
            }
        }
    
        sourceSets {
            all {
                languageSettings.apply {
                    optIn("kotlin.js.ExperimentalJsExport")
                }
            }
            val commonMain by getting {
                dependencies {
                    implementation(kotlin("stdlib-common"))
                    implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.3.2")
                    implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2")
                    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1")
                }
            }
            val commonTest by getting {
                dependencies {
                    implementation(kotlin("test"))
                    implementation(kotlin("test-common"))
                    implementation(kotlin("test-annotations-common"))
                    implementation(kotlin("test-annotations-common"))
                }
            }
            val jvmMain by getting { }
            val jvmTest by getting {
                dependencies {
                    implementation(kotlin("test"))
                    implementation(kotlin("test-junit"))
                    implementation("org.junit.jupiter:junit-jupiter:5.8.2")
                    implementation("org.junit.jupiter:junit-jupiter-params:5.8.2")
                    implementation("io.mockk:mockk:1.12.3")
                }
            }
     ...
    • 1
    • 1
  • v

    Vivek Modi

    05/03/2022, 3:43 PM
    hey guys i am getting weried issue can someone help me
    c
    • 2
    • 7
  • t

    Trey

    05/03/2022, 6:04 PM
    A current project of mine has a flat file with key=value pairs for qa and prod that are loaded at startup. What is the best practice for doing something like this in the shared module of KMM?
    m
    j
    • 3
    • 4
  • b

    Bradleycorn

    05/03/2022, 10:39 PM
    Hi Again Everyone! 👋 Trying to setup Ktor and Coroutines in a KMM library project. I can’t sync, I keep getting errors that none of the dependencies can be resolved for the ios targets. Errors in the screenshot. My
    build.gradle.kts
    is posted in the 🧵 . Any Ideas? Google has been no help at all.
    r
    • 2
    • 2
  • j

    julioromano

    05/04/2022, 8:00 AM
    When building a SQLdelight multiplatform module I’m getting this warning:
    % ./gradlew :database:build
    
    [...]
    
    > Task :database:compileIosMainKotlinMetadata FAILED
    w: Could not find "co.touchlab:sqliter-driver-cinterop-sqlite3"
    Any idea why this happens and how to fix it (I know it’s just a warning but…)? Happy to give more info if only I knew what could help (gradle files, other code…)
    s
    s
    a
    • 4
    • 11
  • v

    Vivek Modi

    05/04/2022, 2:00 PM
    Hey guys, I used koin and I declared the module like this
    fun initKoin(
        appDeclaration: KoinAppDeclaration = {}
    ) = startKoin {
        appDeclaration()
        modules(cartModule)
    }
    
    fun iosKoin() = initKoin() {}
    
    val cartModule = module {
        single { httpClient() }
        single { KtorCountryApi(get()) }
    }
    I have KtorCountryApi class
    class KtorCountryApi(private val httpClient: HttpClient) : NetworkRoute() {
        suspend fun getCountry(): ApiResponse<KtorCountriesResponse> {
           /// api call
        }
    }
    I am calling the iosKoin() in my .swift file in ios project
    t
    j
    • 3
    • 12
  • s

    Slackbot

    05/04/2022, 2:28 PM
    This message was deleted.
    v
    • 2
    • 1
  • b

    brabo-hi

    05/04/2022, 4:54 PM
    hi all, i am using issue integrating sqldelight with KMM with ``app.cash.sqldelight😒qlite-3-38-dialect:2.0.0-alpha02``, it is working for android, but not for the ios
    k
    • 2
    • 10
  • v

    Vivek Modi

    05/04/2022, 9:43 PM
    Hey guys, I am taking to iOS group in slack channel regarding async/await. Some people said that
    async/await kmm bridging support in swift is experimental and not recommended to be used in production currently though.
    So what is the best approach? Any suggestions please
    k
    a
    r
    • 4
    • 15
  • b

    Ben Lancaster

    05/05/2022, 8:18 AM
    is there a way to disable certain targets using gradle properties without wrapping the targets in an
    if
    ?
    🇳🇴 1
    a
    • 2
    • 1
  • v

    Vivek Modi

    05/05/2022, 12:59 PM
    Hey guys, I am trying to use interface in swift, but it unable to find the property
    commainMain
    interface ApplicationToken {
        val accessToken: String
        val refreshToken: String
    }
    iosMain
    Platform.kt
    lateinit var tokenProvider: ApplicationToken
    HttpClient.kt
    actual fun httpClient(config: HttpClientConfig<*>.() -> Unit) = HttpClient(Darwin) {
        config(this)
        engine {
            configureRequest {
                setAllowsCellularAccess(true)
            }
        }
        install(Auth) {
            bearer {
                loadTokens {
                    BearerTokens(tokenProvider.accessToken, "")
                }
            }
        }
    }
    Now when I am to access
    tokenProvider
    in my swift code. It cannot find. I am adding image please have a look.
    r
    • 2
    • 3
  • f

    Francis Mariano

    05/05/2022, 1:25 PM
    Hello everyone. I am trying to change a variable in a singleton and the IDE displayed me the following message:
    With old Native GC, variable in singleton without @ThreadLocal can't be changed after initialization
    . Are there a new Native GC ????
    m
    k
    t
    • 4
    • 4
  • j

    julioromano

    05/05/2022, 5:54 PM
    In Kotlin’s 1.6.20 default hierarchical project structure, what are all the predefined intermediate source sets? The docs talk about
    iosMain
    but not others. Are there more predefined ones?
    m
    m
    m
    • 4
    • 10
  • v

    Vaios Tsitsonis

    05/05/2022, 8:55 PM
    Hello, I try to build a project but it fails. I get the following error
    > Could not download kotlin-native-prebuilt-macos-x86_64-1.6.20.tar.gz (:kotlin-native-prebuilt-macos-x86_64:1.6.20)
       > Could not get resource '<https://download.jetbrains.com/kotlin/native/builds/releases/1.6.20/macos-x86_64/kotlin-native-prebuilt-macos-x86_64-1.6.20.tar.gz>'.
          > Read timed out
    I can download the file manually. Is this an issue with the IDE? Can I do something with the downloaded file and import it manually?
    l
    • 2
    • 3
  • p

    Paul Woitaschek

    05/06/2022, 11:48 AM
    https://blog.jetbrains.com/kotlin/2022/05/kotlin-1-7-0-beta/ Anyone has an idea what this means?
    You can try the Alpha version of the new Kotlin/Native memory manager in Kotlin 1.7.0-Beta. This EAP release brings performance improvements to the new memory manager that will improve the developer experience.
    How do performance improvements improve the developer experience? Is there any more information on that? This sounds like it’s only an improvement of build performance but no behavior change compared to 1.6?
    m
    m
    +3
    • 6
    • 13
  • m

    mike.holler

    05/06/2022, 4:06 PM
    I've got a multiplatform project broken into multiple gradle submodules, some dependent on others. Can someone help me understand what this means?
    > Task :initech-multiplatform-base:compileTestDevelopmentExecutableKotlinJs
    w: duplicate library name: com.initech.cloudsdk:initech-multiplatform-base
    • 1
    • 2
  • v

    Vivek Modi

    05/06/2022, 4:42 PM
    Hey guys, what is the benefits of using
    flow
    over normal
    list/muablelist
    in Kmm project? What is the benefits in ios platform?
    m
    • 2
    • 5
  • m

    mike.holler

    05/06/2022, 5:44 PM
    My KMP builds completely max my CPU -- any way to reduce this on my local machine? I've tried
    --max-workers 2
    but even that still does it. PC is quality -- 8 CPUs i7 processor
    p
    • 2
    • 2
  • t

    Trey

    05/06/2022, 9:39 PM
    I have some existing Android code that uses ticker from kotlinx.coroutines.channels. It doesn't appear to be available for use in commonMain with KMM since it is declared in kotlinx-coroutines-core-jvm. Is there a way for me to use that in commonMain or is there an alternative?
    e
    • 2
    • 8
  • e

    eygraber

    05/06/2022, 10:32 PM
    I have an android target in my multiplatform build, and each module spams the logs with:
    The following Kotlin source sets were configured but not added to any Kotlin compilation:
     * androidAndroidTestRelease
     * androidTestFixtures
     * androidTestFixturesDebug
     * androidTestFixturesRelease
    You can add a source set to a target's compilation by connecting it with the compilation's default source set using 'dependsOn'.
    See <https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#connecting-source-sets>
    What do I need to do to make that stop getting logged?
    👀 1
    s
    j
    • 3
    • 5
  • m

    Marko Novakovic

    05/06/2022, 10:45 PM
    for KMM projects, do you find development experience better in Android Studio or in Intellij IDEA?
    s
    m
    +3
    • 6
    • 6
  • i

    Illusion

    05/09/2022, 1:48 AM
    So, why is this saying unresolved reference? It seems it's saying that every time it's importing something from an outside package Why is this happening and how do I solve this?
    e
    • 2
    • 2
  • v

    Vivek Modi

    05/09/2022, 1:22 PM
    Hey I have existing Android and iOS project. I want to create a separate Kotlin Multiplatform module i.e. put kmm module in separate repository and consume in both platform. 1. My question is can we put module in different repository? Is it good idea to do that? 2. If yes, can we share any guide how can we consume in both platfrom. If no, can you please explain me in details. Thanks
    k
    • 2
    • 4
  • p

    Paul Woitaschek

    05/09/2022, 2:50 PM
    Thank you dear multiplatform developers, best commit of the year ❤️
    🌡️ 7
    :kotlin-intensifies: 3
    🎉 14
    :thumbsup_all: 4
    🔥 8
    m
    k
    +4
    • 7
    • 24
  • e

    eygraber

    05/10/2022, 3:48 AM
    I'm trying to invest in kmp, but I feel like most of my day is spent fighting the tooling instead of coding. Anyone else running into an issue where Android Studio can't resolve common dependencies (external and project)? Note that this is distinct from the issue where Intellij can't resolve common dependencies. https://issuetracker.google.com/issues/231701341
    x
    m
    r
    • 4
    • 10
  • v

    vishal G

    05/10/2022, 7:27 AM
    Kotlin coroutines latest version 1.6. 1 not compatible with iOS in kmm
    j
    f
    • 3
    • 10
  • m

    Matt Nelson

    05/10/2022, 11:10 AM
    Can anyone explain the reason for gradle property
    kotlin.mpp.enableCInteropCommonization=true
    and when it should be used? Should I be using this in the libraries that I publish? Can't find any solid documentation on what it does...
    r
    • 2
    • 3
  • v

    Vivek Modi

    05/10/2022, 11:45 AM
    hey guys, I am reading this doc about Publish a multiplatform library. I am totally new in publish a library. Can someone guide me how to do that. I don't understand what is maven repository and how can i create private one. Also I didn't get it how can store the Kmm module in different repository i.e separate with android source code.
    k
    • 2
    • 2
Powered by Linen
Title
v

Vivek Modi

05/10/2022, 11:45 AM
hey guys, I am reading this doc about Publish a multiplatform library. I am totally new in publish a library. Can someone guide me how to do that. I don't understand what is maven repository and how can i create private one. Also I didn't get it how can store the Kmm module in different repository i.e separate with android source code.
k

Konstantin Tskhovrebov

05/10/2022, 12:34 PM
https://dev.to/kotlin/how-to-build-and-publish-a-kotlin-multiplatform-library-creating-your-first-library-1bp8
v

Vivek Modi

05/10/2022, 12:34 PM
Thank you so much @Konstantin Tskhovrebov
View count: 25