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

    itnoles

    04/21/2021, 3:40 AM
    is it me that Cocoapods libraries are not working on iosMain?
    a
    a
    • 3
    • 4
  • a

    aravind

    04/21/2021, 1:35 PM
    Hi guys, I have tried to send the event from sdk and receive it in android app using BroadcastChannel but it not working can anyone help
    c
    • 2
    • 4
  • s

    Slackbot

    04/21/2021, 2:29 PM
    This message was deleted.
    ➕ 1
    a
    c
    p
    • 4
    • 4
  • b

    Benoît

    04/22/2021, 8:33 AM
    So I've set this up:
    // COMMON MAIN
    expect annotation class Parcelize()
    expect interface Parcelable
    
    // JVM MAIN
    actual interface Parcelable
    actual annotation class Parcelize actual constructor()
    
    // ANDROID MAIN
    actual typealias Parcelize = kotlinx.parcelize.Parcelize
    actual interface Parcelable : android.os.Parcelable
    I can pass objects between Activities/Fragment without a problem, but when my Fragment gets stopped, or if I try to call
    writeToParcel
    myself, my app crashes:
    java.lang.AbstractMethodError: abstract method "void android.os.Parcelable.writeToParcel(android.os.Parcel, int)"
    Any idea?
    e
    • 2
    • 3
  • p

    Paul Woitaschek

    04/22/2021, 9:12 AM
    Is there any way to make inline classes compile as real classes for objective c? It's really weird for the api usage that iOS sees the backing data type exposed.
    d
    • 2
    • 1
  • d

    Dirk Hoffmann

    04/22/2021, 11:23 AM
    did my research, but am not sure, so I'm asking here: what "kind" of dependencies are okay/work to be used in
    sourceSets.commonMain.dependencies { ... }
    ? a) dependencies on MPP libs that have all(!) the used(!) platform-specific variants of libraries with suffixes such as 
    -jvm
    ,
    -macosX64
    ,  
    -linuxX64
    and
    -mingwX64
    supported. b) pure kotlin libs, that do not have any (transitive) dependencies on any platform specific things (?) As I learned a) is true (is it?), but what kind of b) dependencies am I "allowed? to use out-of-the-box in
    commonMain
    that for sure will give me "no issues" if I wanna have native executables for let's say
    macosX64
    ,
    linuxX64
    and
    mingwX64
    ?
    ➕ 1
    t
    p
    • 3
    • 2
  • j

    Julián Falcionelli

    04/22/2021, 12:27 PM
    Hi everyone, I’ve been adding packages to my KMM project and encountered a problem trying to compile this Firebase Wrapper library (https://github.com/GitLiveApp/firebase-kotlin-sdk) for iOS, it seems to be an open issue in their Github page. Does anybody know how to solve this problem? I’ve tried by downgrading the Kotlin version, by upgrading Gradle to the latest version, adding Firebase manually to the iOS project via cocoapods, but I still get the same error 😕 .
    r
    • 2
    • 7
  • t

    thanksforallthefish

    04/22/2021, 1:17 PM
    very dumb question most probably, but I am experimenting for the first time with mpp and would like to write tests in javascript, so that I can verify how the code I wrote in kotlin should be used on the other side (for now I am interested in js and jvm). for instance, in
    commonMain
    I have
    package ...
    
    class HateoasObjectImpl(val any: Map<String, *>) : HateoasObject {
    
      override fun getLink(name: String): Link {
        TODO("Not yet implemented")
      }
    
      override fun getHint(name: String): Hint {
        TODO("Not yet implemented")
      }
    
      override fun getLinkAndHint(name: String): Pair<Link, Hint> {
        TODO("Not yet implemented")
      }
    }
    in
    jsTest
    can I somehow reference this code in a
    js
    file? or that is not possible, since js code is generated when running gradle?
    a
    • 2
    • 5
  • p

    ppav

    04/22/2021, 7:53 PM
    Hello! What could be the problem that the JVM module unresolved reference from Multiplatform module ?
    shared/build.gradle.kts
    in the tread:
    a
    s
    +2
    • 5
    • 25
  • s

    sushma nayak

    04/23/2021, 5:09 PM
    What's the best way to handle different server environments (eg. dev, staging, Prod) in KMM. The urls would remain same for both android and iOS apps. Any links for sample projects doing it would be great.. Thanks.
    d
    b
    m
    • 4
    • 4
  • c

    chrmelchior

    04/23/2021, 10:05 PM
    I’m writing a small logging API for internal use and is running into what looks like a memory leak when calling
    throwable.stackTraceToString()
    on macOS. I caught this as we had some unit tests verifying that things are getting released correctly. Anyone seen anything similar or know a workaround?
    • 1
    • 1
  • x

    xxfast

    04/25/2021, 5:15 AM
    Hi all - I used KMM plugin to generate a multi-platform app. android version builds and runs just fine, but ios run configuration is giving trouble. I can launch xcode and builds and run other apps just fine 🤔 anyone knows what is going on?
    o
    • 2
    • 2
  • r

    rnett

    04/25/2021, 7:24 AM
    A bit of a weird question, but I have a multiplatform project with two JVM source sets and a common source set. I'm using expect actual, so I can't split them into separate projects. I'm trying to depend on one source set. This is easy enough to do via the artifact id, but does not seem possible to do via a gradle
    project
    dependency, which is what I need. Is there any way to do this?
    r
    • 2
    • 3
  • v

    Vitor Prado

    04/26/2021, 1:09 PM
    anyone using compose and swiftui to help me? (I have a question about theming in swiftui)
    m
    • 2
    • 1
  • b

    Berkan

    04/26/2021, 2:25 PM
    Exception in thread "main" java.lang.Error: /var/folders/bj/tngfcb114wx5jxhv1y6b0lz40000gn/T/8243693674587240663.m:1:9: fatal error: module 'DependencyX' not found
    is part of the stacktrace
    a
    • 2
    • 1
  • a

    andrewreitz

    04/26/2021, 3:51 PM
    Hi, I have a multiplatfrom application project setup with
    jvm()
    as one of the targets. When I run
    gradlew tasks
    I don’t see any way to execute the jvm project. I see the other run tasks for native and js, is there something I need to do to setup the jvm one to be executable?
    b
    • 2
    • 33
  • x

    xxfast

    04/26/2021, 11:22 PM
    Any guides on using okio-multiplatform? cant seems to find any usage docs
    r
    • 2
    • 2
  • x

    xxfast

    04/27/2021, 9:10 AM
    androidAndroidTest
    .. ha
    s
    j
    • 3
    • 16
  • m

    Michal Klimczak

    04/27/2021, 5:32 PM
    This might be more of a multiplatform question: how do I extend
    AVAudioPlayerDelegateProtocol
    and not go insane? https://kotlinlang.slack.com/archives/C3SGXARS6/p1619544378255600
    ✔️ 1
    k
    • 2
    • 3
  • b

    Berkan

    04/27/2021, 8:25 PM
    Are all cocoapods dependencies supposed to work in KMP? For example AFNetworking works and its .knm file is generated. But when I add some other random dependency, its .knm file is completely empty
    l
    • 2
    • 26
  • r

    Ryan Simon

    04/27/2021, 11:58 PM
    hey all, I'm running into an interesting challenge trying to setup a multi-module multiplatform project. so my goal is to have one module called
    :core
    and one module called
    :auth
    .
    :auth
    depends on
    :core
    . I also want a Koin setup where
    :auth
    and
    :core
    Koin dependencies can be initialized on each client app. this would allow me to share a network implementation from each client across both modules the problem is that when trying to setup the Koin dependencies on iOS, each module has its own version of the
    Network
    interface.
    :auth
    refers to it as
    AuthCoreNetwork
    and
    :core
    refers to it as
    CoreNetwork
    . with this in mind, we can't properly setup the
    Network
    dependency as the interfaces are incompatible this setup works fine on Android side, but not on iOS. any idea what I could do to solve for this, if anything? code sample of what I'm trying to do on the iOS side below
    func startKoin() {
        NSLog("Hi")
        let doOnStartup = { NSLog("Hello from iOS/Swift!") }
        let network = NetworkManagerImpl()
        
        Core.KoinIosKt.doInitKoinIos(doOnStartup: doOnStartup, network: network)
        Auth.KoinIosKt.doInitKoinIos(doOnStartup: doOnStartup, network: network) // doesn't work because the network instance doesn't match up
    }
    x
    r
    • 3
    • 12
  • i

    iamthevoid

    04/28/2021, 8:40 AM
    Hi, everyone! I’m new in KMM development. Could you advice me please which framework for shared code testing is better?
    b
    • 2
    • 6
  • s

    Sebastian

    04/28/2021, 1:06 PM
    Hey peeps, I’m trying to use Kotlin-based enums and classes in JavaScript/TypeScript but these objects have mangled fields (e.g.
    _category_0
    instead of
    category
    ) and lots of unneeded metadata (e.g. the enums’ hash code values) attached. Do I understand it correctly that I need write custom Serializers to turn these objects into more readable/simple JSON objects? Or what’s a good way to approach this? Perhaps there are some other annotations I need to check? Example below: I’m trying to return a list of question objects with some fields (e.g. an enum-based
    type
    and a list of
    options
    ).
    r
    • 2
    • 8
  • i

    Iaroslav Postovalov

    04/28/2021, 3:24 PM
    @kpgalligan Waiting for your review of https://github.com/touchlab/Stately/pull/59
    b
    • 2
    • 5
  • w

    WukongRework.exe

    04/28/2021, 3:44 PM
    hey guys! im new to multiplatform with kotlin and i was looking into it recently for a personal project and was wondering, whats the difference between different source sets like commonMain and commonJS? if u have any resources to learn more about it would be appreciated! thanks in advance!
    d
    e
    • 3
    • 6
  • a

    aravind

    04/29/2021, 6:32 AM
    guys can i have sample app for broadcast using sharedFlow
    x
    • 2
    • 2
  • j

    Jozef Matus

    04/29/2021, 9:00 AM
    Hi guys, Im writing iosTest tests and trying to test flows (I’m using multithreaded coroutines). Whenever i try to collect on my flow, test just freezes. Is there some material i can read about testing multithreaded coroutines on ios side? Or any ideas why is it happening?
    b
    • 2
    • 6
  • d

    Daniele B

    04/29/2021, 1:03 PM
    I am trying to run the new official KMM sample: https://github.com/Kotlin/kmm-production-sample But I am getting some strange errors. I have tried to stop and restart a couple of times, but I still get the same errors.
    👍🏿 1
    • 1
    • 3
  • b

    Berkan

    04/29/2021, 1:53 PM
    Is there a way to switch a KMM project manually from packForXCode to a cocoapods type?
    j
    • 2
    • 1
  • m

    Michael Stromer

    04/29/2021, 7:40 PM
    Hello! I am thrilled to announce my latest course, “Kotlin Multiplatform Mobile with Ktor” is now live on Udemy! With this course, we dive into Kotlin, Ktor and the future of mobile app development. Learn more: https://www.udemy.com/course/kotlin-multiplatform-mobile/?referralCode=1270BDD4594B47C10373 Free e-book: https://michaelstromer.nyc/books/kotlin-multiplatform-mobile/introduction Feel free to 🧵 with any comments or questions. Thanks for the support!
    👍 5
    👍🏻 1
    r
    • 2
    • 3
Powered by Linen
Title
m

Michael Stromer

04/29/2021, 7:40 PM
Hello! I am thrilled to announce my latest course, “Kotlin Multiplatform Mobile with Ktor” is now live on Udemy! With this course, we dive into Kotlin, Ktor and the future of mobile app development. Learn more: https://www.udemy.com/course/kotlin-multiplatform-mobile/?referralCode=1270BDD4594B47C10373 Free e-book: https://michaelstromer.nyc/books/kotlin-multiplatform-mobile/introduction Feel free to 🧵 with any comments or questions. Thanks for the support!
👍 5
👍🏻 1
r

Robert Jaros

04/29/2021, 8:02 PM
Would it be possible to take your course without any GraphQL knowledge?
m

Michael Stromer

04/29/2021, 8:04 PM
Hey Robert, yes you could definitely take the course without prior knowledge of GraphQL. Here’s an article I would recommend reading first: https://www.apollographql.com/blog/graphql-vs-rest-5d425123e34b/
r

Robert Jaros

04/29/2021, 8:07 PM
Thanks!
View count: 5