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

    spierce7

    05/17/2019, 3:39 AM
    If I have a multiplatform project, and have multiple jvm variants, and I have a jvm module in the same gradle project, how do I include a specific variant of the multiplatform project as a dependency?
    d
    r
    b
    • 4
    • 10
  • d

    Dmitry Motyl

    05/17/2019, 11:43 AM
    When I run test via Run button in Android Studio I got Exception “No runnable methods” Can I run and debug test in multiplatform ?
    r
    • 2
    • 1
  • s

    spierce7

    05/18/2019, 7:45 PM
    How do I do
    provided
    dependencies with the Kotlin multiplatform plugin?
    r
    • 2
    • 2
  • s

    spierce7

    05/19/2019, 4:31 AM
    If I have a source-set that other source-sets depend on, it seems that source-set is assumed to be common. Is there a way to specify that a source set is a specific platform? If I don't specify the platform, then I lose the ability to import platform specific libs. To work around this currently I'm specifying an unused target.
    y
    g
    • 3
    • 4
  • m

    Marc Knaup

    05/19/2019, 7:23 PM
    Any idea yet how a multiplatform date+time library could look like? Like
    java.time
    ? Or like Swift's? Or a mix of both? Java's seems to be focused on the Gregorian calendar while Swift's is more generic.
    m
    c
    +4
    • 7
    • 11
  • m

    Marc Knaup

    05/20/2019, 1:33 PM
    Is there a specific reason why the common
    StringBuilder
    is append-only? I.e. no replace/delete.
    t
    • 2
    • 4
  • m

    mben

    05/20/2019, 2:54 PM
    Hello does anyone have a sample code for sqldelight used in kotlin multiplatform using expect and actual for driver implementation pleaz?
    s
    • 2
    • 8
  • k

    Kris Wong

    05/20/2019, 4:14 PM
    uhhhhhh.... there is no iosX32 preset. i386 is required for iOS 10 support...
    • 1
    • 2
  • k

    Kris Wong

    05/20/2019, 6:55 PM
    have anyone received this error trying to build a fat framework: Could not get unknown property 'FatFrameworkTask' for object of type org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension?
    t
    • 2
    • 26
  • m

    Marc Knaup

    05/20/2019, 7:32 PM
    This is a bit nuts 🤔
    expect class Platform_TimeZone
    // common
    actual typealias Platform_TimeZone = ZoneId
    // JVM - error because incompatible modality (ZoneId is abstract)
    actual typealias Platform_TimeZone = NSTimeZone
    // iOS - works fine If I make the expected class abstract, then it's the other way round 😞 Any way to work around that without wrapping everything in a new class?
    d
    j
    • 3
    • 3
  • b

    basher

    05/20/2019, 11:24 PM
    Anyone have examples of a mpp framework that needs to dynamically link against another framework?
    k
    o
    +2
    • 5
    • 22
  • j

    Jonas Bark

    05/21/2019, 6:27 AM
    Is there an updated multiplatform plugin available for
    1.3.40-eap-21
    ? Right now it doesn't seem like it (kotlin-eap repo)
    s
    i
    • 3
    • 4
  • a

    Andy Victors

    05/21/2019, 6:28 AM
    Any ideas why
    AtomicReference
    is not available for me in common code? According to documentation is should be. Kotlin '1.3.30'
    s
    o
    +2
    • 5
    • 42
  • r

    robnik

    05/21/2019, 10:12 AM
    Is there an example or documentation somewhere that shows how to use JS DCE (dead code elimination) with the multiplatform setup?
    h
    • 2
    • 1
  • d

    Dico

    05/22/2019, 2:08 AM
    What is the equivalent of the
    compile
    configuration for a java target in a multiplatform project? I used to have a way of including dependencies into a jar task, but since 1.3.31, it no longer works
    g
    • 2
    • 4
  • k

    kpgalligan

    05/22/2019, 3:04 AM
    Poked around Reaktive from Badoo. https://github.com/badoo/Reaktive. It seems to work OK, but can be quite unforgiving on the native side when things go wrong, and it really needs a set of extensions to avoid same-thread state capture freezing: https://twitter.com/kpgalligan/status/1130579650055417856 Testing was super limited, however. Not idea about general performance or anything else, but it’ll push you db updates to the screen.
    o
    a
    • 3
    • 5
  • e

    EnricCamarero

    05/22/2019, 3:03 PM
    Hi fellows! I’m struggling to make a multiplatform app in which the webApp should be made with Kotlin + React. So far I’ve been able to make it work with kotlin2js but I cannot even get the dependencies right to start writing juicy reactive code. Which dependencies should I use write Kotlin in a ReactJS fashion - or viceversa?
    f
    t
    • 3
    • 4
  • a

    Andy Victors

    05/23/2019, 8:01 AM
    How to figure out what is being mutated [and causes an exception] during coroutine call, invoked from iOS code? The code is already as simple as that:
    override fun fetch() {
            println("Fetch:start: Running in ${currentThreadName()} ")
            println("Fetch:start: Frozen? -> ${this.isFrozen()} ")
            launch(Dispatchers.Unconfined) {
                println("Fetch:launch: Running in ${currentThreadName()} ") 
             }
           }
    Exception is in discussion thread ...
    r
    e
    • 3
    • 7
  • a

    Andy Victors

    05/23/2019, 9:10 AM
    Why do I get
    kotlin.native.concurrent.InvalidMutabilityException
    [called from iOS] in the
    init()
    method by setting the
    value
    ? During init() the object should not be frozen, right? (confirmed by println in code).
    var value: Float
        init {
            println("MetricReference:init (${metric.name} ): Frozen? -> ${this.isFrozen()} ")
            this.metric = metric
            this.metric.addObserver(this)
            this.value = metric.getValue()
        }
    r
    b
    • 3
    • 4
  • d

    Dmitry Motyl

    05/24/2019, 11:24 AM
    I cant setup plugin plugin: ‘org.jetbrains.kotlin.xcode-compat’ with code:
    kotlin { xcode {
            setupFramework('shared')
        } }
    I got
    Gradle DSL method not found: 'setupFramework()'
    Could somebody help?
    h
    i
    v
    • 4
    • 4
  • a

    AdrianRaFo

    05/24/2019, 1:50 PM
    Hi, I'm trying to add a
    common
    module as a dependency to another
    common
    module but I'm not able to get it working. I tried with
    implementation
    ,
    api
    and
    compileOnly
    but any of them give me a successful
    build
    . Could anyone helps me?
    k
    g
    h
    • 4
    • 14
  • k

    Kris Wong

    05/24/2019, 2:10 PM
    i see there's an
    allJvm
    . is there an
    allIos
    ?
    r
    • 2
    • 2
  • b

    basher

    05/24/2019, 6:54 PM
    Hi! I'm trying to add a dependency to our MPP project and have everything public from that dependency exported as obj-c classes in that framework. we tried the
    export
    thing in
    binaries.framework
    , but that doesn't seem to work. Anyone else have success with this?
    k
    r
    s
    • 4
    • 12
  • b

    basher

    05/24/2019, 9:52 PM
    Does anyone have an example of including a subproject that's an mpp project into an mpp project?
    d
    • 2
    • 3
  • c

    CLOVIS

    05/25/2019, 3:18 PM
    Is there a Kotlin Multiplatform JSON library? I've read about Ktor and from what I understand it uses a different engine per platform, but it doesn't provide any common API so as soon as JSON handling happens it needs to be platform-specific?
    r
    m
    k
    • 4
    • 5
  • c

    CLOVIS

    05/26/2019, 8:52 AM
    The documentation states that iOS targets can only be built on a MacOS host. Would a Docker container work? Or does it have to actually be MacOS
    d
    g
    l
    • 4
    • 8
  • t

    thana

    05/26/2019, 10:30 AM
    we'd like to use something like mikrometer to implement some application monitoring. is there a way to put the needed annotations on my
    common
    code? Is there a different approach to achieve our goal? any suggestions? (i'd be completly fine with havong those metrics on my jvm-target only - i don't need them on the other platforms, if this helps)
    l
    • 2
    • 2
  • d

    Dominaezzz

    05/26/2019, 9:56 PM
    Not sure where to ask for this but... In gradle (kts) can the
    sourceSets
    function's receiver be changed from
    NamedDomainObjectContainer<KotlinSourceSet>
    to
    NamedDomainObjectContainerScope<KotlinSourceSet>
    ? (Or just delete the function altogether since the object is available) It allows for
    "commonMain" { }
    also, instead of just
    val commonMain by getting { }
    .
    g
    • 2
    • 21
  • j

    Jan Stoltman

    05/27/2019, 9:48 AM
    Hey guys, are function references available for K/N? I have functions like these ones:
    //Declaration
    fun <K,V>cache(getNew: suspend () -> List<Pair<K, V>>)
    //Usage
    cache(::getAllChannelsFromApi)
    When compiling for Android everything works fine, but on iOS I get
    Type mismatch: inferred type is KSuspendFunction0<List<Pair<Int, Channel>>> but suspend () -> List<Pair<Int, Channel>> was expected
    d
    o
    • 3
    • 3
  • d

    Dmitry Motyl

    05/27/2019, 1:36 PM
    What does plugin “xcode-compat” need for?
    a
    l
    r
    • 4
    • 5
Powered by Linen
Title
d

Dmitry Motyl

05/27/2019, 1:36 PM
What does plugin “xcode-compat” need for?
a

Artyom Degtyarev [JB]

05/27/2019, 4:58 PM
Basically, this plugin reduces the number of manipulations that you need to build your project from the Xcode. Xcode usually sends builds parameters as
envvar
’s, but you need to extract these parameters (I mean things like architecture, etc.) and send to Gradle build - just because of K/N way to build project.
xcode-compat
just makes it automatically check this https://github.com/JetBrains/kotlin-xcode-compat/blob/master/xcode-compat/src/main/kotlin/org/jetbrains/kotlin/xcodecompat/XcodeCompatPlugin.kt
l

louiscad

05/27/2019, 5:50 PM
Is there any example using it?
r

russhwolf

05/28/2019, 1:14 AM
AppCode’s Kotlin/Native project templates use it
Though I still have some questions. It’s not clear to me how to configure the plugin so that debug builds in xcode use a debug framework and release builds use a release framework.
Also it appears to only work using kts build scripts but I’m not sure if that’s deliberate or a bug.
View count: 2