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

    Kris Wong

    03/25/2020, 8:50 PM
    Using 'IOException' is an error. These classes accidentally slipped to the public API surface. We neither had intent to provide a production-quality implementation nor have an intent to support them.They are removed and to migrate, you can either use a corresponding java.io type or just a copy-paste implementation from the GitHub.If you have a use-case for multiplatform IO, please report it to the https://github.com/Kotlin/kotlinx-io/issues
    t
    • 2
    • 1
  • s

    spierce7

    03/26/2020, 4:45 AM
    The
    multiplatform
    plugin seems to get confused by Android flavor source sets with expect / actual. i.e. I have an expected declaration inside of
    src/commonMain
    , and then for Android I have actual declarations inside of
    src/internal
    and
    src/production
    (the folders for Android Flavors). I’m seeing the following error:
    Actual object <class name> has no corresponding `expected` declaration.
    Redeclaration <class name>
    Does anyone know of a solution? The error is only in the IDE. The app compiles fine.
    g
    • 2
    • 2
  • s

    Stefan Beyer

    03/26/2020, 8:56 AM
    Hi 🙂 I tried 1.4-M1 with the new js ir backend this week and I realized, that the
    @JsExport
    annotation is throwning a wrench into my project. Maybe you folks have an idea on how to do this correctly? My goal is to have a Kotlin common sorce set, which should be compiled to js and jvm. This will be a common library, that will be used by the frontend (React with TypeScript) and the backend (Spring Boot with Kotlin) and will contain common data structures, validation logic and some particularly complex bits of business logic that need to be executed on both platforms. Now my train of thought was to just implement all of this in the commonMain source set and leave the jsMain and jvmMain source sets empty. This works fine for the jvm target: I get a .jar file with all the classes and functions defined in the common code. But for js, everything that should be exported needs to be annotated with
    @JsExport
    for it to actually being compiled to js. Does this mean I have to populate the jsMain source set with a wrapper for each class and function that exists in commonMain, just to be able to compile this to js? This does not sound very pragmatic. is there maybe a way to tell the compiler to always export classes and functions from a certain package?
    b
    i
    +2
    • 5
    • 13
  • m

    mbonnin

    03/26/2020, 1:35 PM
    What's the recommended way to publish multiplatform libraries to
    bintray
    these days ? For regular JVM projects, I'm able to publish with
    maven-publish
    by using the bintray API and
    <https://api.bintray.com/maven/subject/repo/package>
    as url but this doesn't work anymore on multiplatform projects since a project (in the gradle meaning) will have multiple packages (in the Bintray meaning), one for each arch.
    l
    i
    • 3
    • 18
  • d

    Derek Ellis

    03/26/2020, 1:40 PM
    What do people usually do for dependency injection on the Swift/iOS side of Multiplatform projects (or js for that matter)? I've tried Kodein but manually binding everything for constructor injection was a chore to say the least.
    k
    • 2
    • 5
  • k

    Kris Wong

    03/26/2020, 2:23 PM
    damnit. sqldelight hasn't updated for 1.3.7x. i was so close to getting everything updated!!
    j
    b
    • 3
    • 6
  • s

    spierce7

    03/26/2020, 2:43 PM
    @Kris Wong I too feel your pain. Library incompatibility between versions is proving to be far more painful than I expected.
    ➕ 1
    k
    k
    +4
    • 7
    • 42
  • k

    Kris Wong

    03/26/2020, 6:27 PM
    i have one project in which IDEA seems to run my
    fatFramework
    task every time it reimports the gradle files. it's so strange
    • 1
    • 1
  • o

    Orhan Tozan

    03/27/2020, 12:09 AM
    I frequently get this error message in my multi module project. Error goes away after I clean the project. Really annoying.
    l
    t
    • 3
    • 4
  • r

    rnentjes

    03/27/2020, 2:17 PM
    Testing out 1.4-M1 I'am getting the following exception in the compiler during compileKotlinJs:
    e: java.lang.RuntimeException: No INDEXED_LVALUE_GET for ARRAY_ACCESS_EXPRESSION: KtParenthesizedExpression:
    Anyone know what causes this?
    b
    • 2
    • 2
  • j

    jeggy

    03/28/2020, 6:42 PM
    I'm creating a Kotlin Library. If I want this library to have multiplatform support. Do I need any specific configuration or is it fine to just make sure that all libraries that I use do have multiplatform support? like coroutines?
    t
    • 2
    • 4
  • s

    sean

    03/28/2020, 8:47 PM
    Is any one using gitlab packages with kotlin multi platform? I'm getting a fringe bug where the
    version
    becomes the
    artifactId
    and the
    version
    becomes
    null
    . The same upload works on sonatype nexus
    m
    • 2
    • 3
  • i

    Igor Drozdov

    03/29/2020, 12:17 PM
    Hey team, I’m trying to run first time multiplatfrom Kotlin app. I’ve created project from idea template, but it fails with the following error:
    org.jetbrains.kotlin.konan.MissingXcodeException: An error occurred during an xcrun execution. Make sure that Xcode and its command line tools are properly installed.
    Besides at the same time I’m able to compile and run it from Xcode What could be configured wrong?
    t
    • 2
    • 3
  • d

    Dave Leeds

    03/29/2020, 9:00 PM
    So it looks like it only runs the common tests on iOS instead of also on JVM. Any ideas what needs to be reconfigured in order to get the platform-picker menu for the iOS/Android project?
    l
    • 2
    • 2
  • g

    Gunslingor

    03/30/2020, 12:15 AM
    wwhat css dsl should I use for a multiplatform project with ktor jvm and kotlin js/HTML? I heard kotlinx.css was discontinued, wondering why I am bothering with kotlinx.html if that's the case
    • 1
    • 1
  • g

    Gunslingor

    03/30/2020, 6:33 AM
    My god there is so many web frameworks already... kotlin react, kvision, kotlinx, ktor, mutliplatform primatives, this is all too much to choose from, lol... been playing with kotlin-react, seems okay except it isn't honoring my exernal css and js like metro4 package. is kvision any good, which would you use? and another https://github.com/Kabbura/Kunafa!!!! I was using kotlinx html fairly reliably once I figure it out but it was making bigger code than kotlin-react. The reason I am considering switching is because it lacks a CSS DSL.
    s
    • 2
    • 21
  • m

    Mikołaj Kąkol

    03/30/2020, 7:01 AM
    Hi, are Kotlin 1.3.70 and 1.3.71 binary compatible? I see that
    kotlinx.serialization
    was build with 1.3.70 so can I use it with 1.3.71?
    :yes: 3
    👍 2
    ✔️ 2
    m
    f
    • 3
    • 5
  • f

    Fabian de Almeida Ramos

    03/31/2020, 7:57 AM
    Hi all, I’ve been trying to add an Android library to my Android/iOS multiplatform project, but I’m getting the error
    Default interface methods are only supported starting with Android N (--min-api 24)
    Been looking around, and it seems I have to set the
    sourceCompatibility
    and
    targetCompatability
    in
    compileOptions
    .. it’s just that I don’t know where to do that, as the
    android { … }
    closure is not found. Using kotlin gradle btw.
    • 1
    • 1
  • c

    Christian Sousa

    03/31/2020, 11:34 AM
    anyone has any experience working with JFrog Artifactory? I’m generating and publishing to a local repo but I can’t seem to be able to use the lib on another project. The problem I’m facing is that the aar is published but on my other project, I can’t use the code anywhere, and on my external libraries, I can only see: Gradle: com.christiansousa.lib:MyLib -> classes.jar but inside it there’s only:
    MyLib-release.kotlin_module
    and not any of the classes. Sorry if it’s not the right place to ask this but since I can only see the
    *.kotlin_module
    on my External Libraries I thought this would be the best place to ask.
    k
    • 2
    • 28
  • k

    KamilH

    03/31/2020, 3:07 PM
    Is there any kind of roadmap for Kotlin Multiplatform? Is here any place where I can see what is the current state of the project (for example what is implemented, what needs improvement, what are a risk etc.)? In my company we are looking for a best Multiplatform solution to invest in near future and as we are mobile agency with a lot of experience in native Android/iOS, the most logical stap would be Kotlin Multiplatform, but we would like to understand a risks
    j
    • 2
    • 3
  • s

    spierce7

    03/31/2020, 8:47 PM
    I’m seeing an exception working with Flow across threads in Kotlin/native using the
    native-mt
    version of kotlinx.coroutines. I’ve been stuck on this for a while now. Can anyone point me in the right direction for how to fix this? It’s throwing an error on the
    emit(defaultValue)
    .
    Caused by: kotlin.native.concurrent.InvalidMutabilityException: mutation attempt of frozen kotlinx.coroutines.flow.internal.SafeCollector@f506be8
    k
    • 2
    • 5
  • y

    yshrsmz

    04/01/2020, 8:00 AM
    Hi, I've encountered a weird error while upgrading my KMP library to Kotlin 1.3.71. My lib consists of two modules, one is core KMP lib, and the other is a Gradle plugin. When I try to execute test cases for the Gradle plugin, one of these throws an error like
    e: Could not find "kotlinx-serialization-runtime" in [/Users/yshrsmz/repos/github.com/yshrsmz/kgql, /Users/yshrsmz/.konan/klib, /Users/a12897/.konan/kotlin-native-macos-1.3.71/klib/common, /Users/yshrsmz/.konan/kotlin-native-macos-1.3.71/klib/platform/ios_x64].
    Here's the repo https://github.com/yshrsmz/kgql/tree/kotlin1.3.71-builderror If you run
    $ ./gradlew build
    at the root directory,
    The generate task is a dependency of multiplatform ios target - X64
    test fails. https://github.com/yshrsmz/kgql/blob/kotlin1.3.71-builderror/kgql-gradle-plugin/src/test/kotlin/com/codingfeline/kgql/gradle/KgqlPluginTest.kt#L166-L181 The weirdest part is, this test some time passes. It fails almost all the time, but sometimes it succeeds.
    i
    • 2
    • 6
  • o

    Orhan Tozan

    04/01/2020, 8:15 AM
    Hi, our team have been trying to setup kotlin multiplatform for a month now, and everything seems to be going well from calling mpp code from android. However our iOS dev just build our mpp codebase and says that the compiled code from kotlin mpp is objective c instead of swift, and although our iOS repo swift code swift can call the compiled mpp objective c, it misses some features compared to something that was written in Swift. An example he gave me is that NSMutableArray is being created for MutableList instead of a regular swift typed array. Is there something we miss in our configuration, since I assume most of the people use Swift on iOS side?
    a
    r
    s
    • 4
    • 21
  • a

    aiidziis

    04/01/2020, 9:16 AM
    Hey! Is it currently possible to test callbacks in
    commonTest
    ?
    t
    • 2
    • 7
  • c

    curioustechizen

    04/01/2020, 10:46 AM
    Hello everyone. Does anyone have any guides for extending the kotlin multiplatform
    cocoapods
    plugin such that it publishes the compiled
    .framework
    file to a (private) remote repo? My goal is to be able to consume the
    .framework
    file remotely instead of from the local file system. I've seen some examples on the cocoapods website but most of the examples talk about publishing the source (looks like cocoapods builds the framework from source). This is not what I want.
    r
    • 2
    • 4
  • c

    Christian Sousa

    04/01/2020, 4:49 PM
    For Interoperability, do I only need to do:
    kotlin {
        cocoapods {
            // Configure a dependency on AFNetworking.
            // The CocoaPods version notation is supported.
            // The dependency will be added to all macOS and iOS targets.
            pod("AFNetworking", "~> 3.2.0")
        }
    }
    ? Because I did that and then on my ios part I cant import it because it says that AFNetworking is an unresolved reference
    m
    s
    • 3
    • 60
  • j

    jw

    04/01/2020, 6:52 PM
    can i add custom java source dirs for a
    jvm { withJava() }
    target?
    s
    l
    • 3
    • 7
  • g

    Gunslingor

    04/02/2020, 12:15 AM
    For the default setup what should the classpath be in this case?
    jvm() {
        compilations {
            val main by getting
            tasks {
                register<JavaExec>("run") {
                    setMain("com.project.MainAppKt")
                    println(main.output.classesDirs)
                    classpath = main.output.classesDirs
                }
            }
        }
    }
    • 1
    • 1
  • p

    phldavies

    04/02/2020, 1:46 PM
    Bringing this out of the 11day old thread in case anyone else can help?
    k
    r
    b
    • 4
    • 11
  • c

    Christian Sousa

    04/02/2020, 4:06 PM
    Hello guys, can anyone give me some help regarding the 
    moko-resources
     ? I’m trying to build my project but it always gives me the following: 
    Object 'MR' has several compatible actual declarations in modules...
      It seems that it’s generating code for iosx64 and iosarm64. Anyone had a problem like this?
    a
    • 2
    • 1
Powered by Linen
Title
c

Christian Sousa

04/02/2020, 4:06 PM
Hello guys, can anyone give me some help regarding the 
moko-resources
 ? I’m trying to build my project but it always gives me the following: 
Object 'MR' has several compatible actual declarations in modules...
  It seems that it’s generating code for iosx64 and iosarm64. Anyone had a problem like this?
a

alex009

04/02/2020, 6:33 PM
hi! yes, it generate code for both ios targets. this error showed to you when you compile iOS targets? can you show how you configure targets?
View count: 3