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

    ankushg

    09/20/2018, 9:39 PM
    Is the new MPP plugin considered part of Kotlin 1.3-RC, or is it independent from it?
    o
    2 replies · 2 participants
  • a

    alec

    09/20/2018, 9:41 PM
    is it possible to publish klib's with the new MPP plugin?
    o
    1 reply · 2 participants
  • a

    alec

    09/20/2018, 9:41 PM
    in particular for iOS arm/x64 architectures
    k
    1 reply · 2 participants
  • f

    fabianterhorst

    09/21/2018, 11:28 AM
    Im not able to get kotlin native library to build with latest mpp 1.3.0-rc-57
    Could not resolve all files for configuration ':common:iosArm64CompileKlibraries
    Could not resolve org.jetbrains.kotlinx:kotlinx-serialization-runtime-native:0.8.0-rc13.
      Required by:
          project :common
       > Unable to find a matching configuration of org.jetbrains.kotlinx:kotlinx-serialization-runtime-native:0.8.0-rc13:
     Configuration 'debugIos_arm64Link':
               - Found org.gradle.native.debuggable 'true' but wasn't required.
    .
    l
    k
    11 replies · 3 participants
  • h

    hmole

    09/23/2018, 8:00 AM
    Does anyone have a working example with new multiplatform plugin and ios app/test? After lot of struggle I got to a point where xcode compiles and links everything, but when I run the test I get
    Library not loaded: @rpath/MyFramework.framework/MyFramework
    Nvm it's working. Just don't use tests and add the framework through
    Embedded binaries
    if anyone across this issue
    t
    f
    +1
    5 replies · 4 participants
  • a

    ankushg

    09/25/2018, 2:04 AM
    Does the new KMPP plugin support dead code elimination for JS source sets? Haven't been able to find an example that uses it and I don't see any tasks involving DCE when I run
    ./gradlew tasks
    ...
    l
    7 replies · 2 participants
  • a

    ankushg

    09/25/2018, 2:12 AM
    Also, in this sample: https://github.com/h0tk3y/k-new-mpp-samples/tree/master/lib-with-tests
    ./gradlew jsTest
    doesn't actually run any tests for JS. It looks like it spits out a file into
    build/classes/kotlin/js/test/lib-with-tests_test.js
    , but the report in
    build/reports/tests/jsTest/index.html
    says 0 tests run. Is there a working sample with the new MPP plugin where the JS tests are set up to actually run?
    l
    1 reply · 2 participants
  • h

    hmole

    09/25/2018, 6:40 PM
    Can I depend on artifacts published with old multiplatform structure in my
    kotlin-multipplatform
    module?
    l
    9 replies · 2 participants
  • r

    rudolf.hladik

    09/26/2018, 7:58 AM
    Hello, is there any guide, how to create this (https://github.com/JetBrains/kotlin-mpp-example) kind of project from scratch? I’ve tried to follow this https://github.com/JetBrains/kotlin-native/blob/master/MULTIPLATFORM.md but with no success especially wiring common/shared module as framework to new xcode project. Also I’ve seen different project structures, one with common module at root of project with three source sets for common, common-platform-ios, common-platform-android and the other one with three seperate modules for common, common-platform-ios, common-platform-android. Problem is, it is hard to find out which build.gradle settings and dependencies are for which source set.
    t
    l
    5 replies · 3 participants
  • t

    thevery

    09/26/2018, 4:56 PM
    I know there is no reflection support to js and native, but is there any way to implement dynamic proxy? I want to create something like https://github.com/square/retrofit for common code (Android+iOS)
    d
    o
    +2
    15 replies · 5 participants
  • k

    kpgalligan

    09/27/2018, 6:43 PM
    Reposting here: https://twitter.com/kpgalligan/status/1045383090057760768
    t
    o
    +4
    32 replies · 7 participants
  • r

    r4zzz4k

    09/28/2018, 5:29 PM
    Is it expected that
    runtimeClasspath
    configurations for JVM targets doesn't contain actual compilation output, only dependencies? The only way I was able to use
    application
    plugin is as follows:
    tasks.findByName("run").configure {
        classpath = kotlin.targets.jvm.compilations.main.output + project.configurations.jvmRuntimeClasspath
    }
    (
    jvm
    target is, of course, created like this:
    fromPreset(presets.jvm, 'jvm')
    )
    l
    h
    7 replies · 3 participants
  • j

    jw

    09/28/2018, 9:03 PM
    how can I change the artifactId of artifacts in the new multiplatform module? it seems to use the project name and there's no way to override it except to manually set the artifactId on each publication which is error-prone because you have to manage the automatically-added suffixes yourself
    o
    h
    3 replies · 3 participants
  • h

    hmole

    09/29/2018, 10:55 AM
    How can I write platform native code for multiple targets?
    nativeCommonMain
    source set isn't resolving imports from stdlib-native. Only specific targets like iosX64/iosArm64 work. Idea
    2018.2.4
    Kotlin
    1.3.0-rc-116
    l
    4 replies · 2 participants
  • f

    fabianterhorst

    09/29/2018, 4:23 PM
    Is there already an fix for the kotlinx serialization and kotlin native mpp incompatibility?
    k
    s
    +1
    40 replies · 4 participants
  • f

    felipecsl

    09/29/2018, 5:21 PM
    by common I mean specifically
    kotlin-platform-common
    e
    l
    5 replies · 3 participants
  • t

    thevery

    10/01/2018, 12:48 PM
    With new mpp plugin, how to enable both
    iosArm64
    and
    iosArm32
    in one config? Or probably even all 3 with iosX64.
    f
    l
    +2
    13 replies · 5 participants
  • j

    Jaroslav

    10/02/2018, 7:50 AM
    Is there a way to have support for ios part of the project in IntelliJ IDEA CE? atm if i implement
    actual
    object it complains that there is no expected part found. Android part works fine
    t
    4 replies · 2 participants
  • h

    Hamza

    10/04/2018, 11:22 AM
    i have a tiny question regarding the documentation and the nature of the multiplatform way of working. https://kotlinlang.org/docs/reference/multiplatform.html if i create an expect function in the common code, and an actual in the JVM, from the JVM, can i also expect the actual function to exist, ergo call the actual function, which is in the JVM from JavaScript?
    h
    j
    6 replies · 3 participants
  • h

    hallvard

    10/06/2018, 2:43 PM
    I am struggling to port some older code from a jvm-only project to combined jvm/js. One of my classes was extending java.util.HashMap, which is now impossible, of course, as the kotlin HashMap is a final class. Seems I have two options: 1) implement Map and add
    entries()
    ,
    keys()
    ,
    size()
    ,
    containsKey()
    etc or 2) remove class inheritance and reduce the map to a backing field. Or did I miss something? (Hoping so. Would like to change as little as possible.)
    o
    g
    5 replies · 3 participants
  • s

    Sam

    10/06/2018, 9:25 PM
    If I have a set of targets defined from presets what is the command line invocation to just build/test one of the targets?
    targets {
            fromPreset(presets.iosX64, 'ios') {
                compilations.main.outputKinds('FRAMEWORK')
            }
            fromPreset(presets.android, 'android')
            fromPreset(presets.jvm, 'jvm')
        }
    l
    1 reply · 2 participants
  • s

    Slackbot

    10/07/2018, 3:26 AM
    This message was deleted.
    s
    h
    2 replies · 3 participants
  • h

    hallvard

    10/07/2018, 3:35 PM
    With 1.3, I define all the different platforms in one single gradle file, thanks! It really is a great improvement! But does anyone know how I specify the jvm target now? Idea complains I use
    assertThrows
    in my tests, and this causes a jvm1.6/jvm1.8 clash/mismatch ...
    3 replies · 1 participant
  • s

    spierce7

    10/08/2018, 4:14 PM
    Using the new mpp plugin, if I have an expected declaration in the commonMain module, and have an ios and iosSim target, no matter what I try, the IDE tells me I have to have actual declarations in both source sets. Even if I do something like:
    configure(targets.iosSim) {
                compilations.main.source(sourceSets.iosMain)
            }
    Is there any way around this?
    o
    3 replies · 2 participants
  • h

    hmole

    10/09/2018, 9:18 AM
    How do I use
    kapt
    on android(
    main
    ) sources of multiplatform project? I can't apply
    kotlin-android
    , because it says
    kotlin
    extensions is already added, but without it there is no
    kapt
    configuration.
    g
    3 replies · 2 participants
  • s

    salomonbrys

    10/09/2018, 9:47 AM
    Hey everyone. Using the new MPP gradle plugin, is it possible to have a source set that's common to all native and that's recognized by IDEA as such ?
    l
    t
    5 replies · 3 participants
  • h

    hallvard

    10/09/2018, 1:36 PM
    Can I
    expect
    only two methods out of fourteen in a class? Seems I must `expect`the whole class, and I cannot then have
    actual
    implementations inside the same code, but need to implement all fourteen functions as
    actual
    functions in my JS and JVM specific packages. (I tried using extension functions, but Java doesn't recognize those, so to no avail. Another solution is to have the two functions call some other function that could be marked with
    expect
    and that one could live outside of the class. But what I really would like the most, and find most intuitive, is being able to `expect`only some of the functions in a class, just like we do with abstract classes.
    r
    1 reply · 2 participants
  • k

    kpgalligan

    10/09/2018, 4:20 PM
    I'm sure this has been repeatedly asked/answered, but how do you actually run tests in the mpp?
    s
    t
    +2
    10 replies · 5 participants
  • t

    tapchicoma

    10/09/2018, 7:56 PM
    does anyone has example that has new kotlin multiplatform plugin combined with application plugin?
    t
    h
    +1
    5 replies · 4 participants
  • a

    ankushg

    10/10/2018, 3:15 AM
    Maybe a dumb question: When using the new multiplatform plugin with
    1.3.0-rc-146
    , running
    jvmTest
    (using
    kotlin-test
    and
    kotlin-test-junit
    ) doesn't actually output anything to the CLI or IDE indicating how many/which tests passed/failed. I just get messages like or
    > Task :pinyin-converter:jvmTest FAILED
    or
    > Task :pinyin-converter:jvmTest
    , followed by
    Task execution finished 'jvmTest'.
    . The task does spit out a more detailed test report in
    build/reports/tests/jvmTest/index.html
    . Is this lack of IDE or CLI output normal? Is there an example project that's configured to provide more detailed test results in the IDE and/or CLI?
    t
    l
    5 replies · 3 participants
Powered by Linen
Title
a

ankushg

10/10/2018, 3:15 AM
Maybe a dumb question: When using the new multiplatform plugin with
1.3.0-rc-146
, running
jvmTest
(using
kotlin-test
and
kotlin-test-junit
) doesn't actually output anything to the CLI or IDE indicating how many/which tests passed/failed. I just get messages like or
> Task :pinyin-converter:jvmTest FAILED
or
> Task :pinyin-converter:jvmTest
, followed by
Task execution finished 'jvmTest'.
. The task does spit out a more detailed test report in
build/reports/tests/jvmTest/index.html
. Is this lack of IDE or CLI output normal? Is there an example project that's configured to provide more detailed test results in the IDE and/or CLI?
t

tarek

10/10/2018, 8:14 AM
You can add this to your build.gradle at the top level
tasks.withType(Test) {
    testLogging.events = ["passed", "skipped", "failed"]
}
or
tasks.withType(Test) {
    testLogging.showStandardStreams = true
}
l

Liliia

10/10/2018, 9:36 AM
Which IDE do you use? There is an issue with Android Studio (https://youtrack.jetbrains.com/issue/KT-27373), but it’s expected to work in IDEA CE, as well as UE. To get a minimal sample, you may simply create a project through New Project Wizard in IDEA — there is a bunch of multiplatfrom samples at Kotlin section. For example, choose
JS Client/JVM Server
, then run Gradle
check
task (which is described here: http://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#running-tests) — you should be able to see the results in the tool window
a

ankushg

10/10/2018, 2:10 PM
Ahh thanks for that @tarek and @Liliia I’m running in Android Studio, so that explains the lack of test events being received. Is there any indication that this problem will be resolved some time soon? Or is it likely that 1.3 will go stable without this being fixed? @tarek’s suggestion is a good enough workaround for the time being 😊
l

Liliia

10/10/2018, 3:54 PM
I’ll come back with an ETA in the end of the week 🙂 Or you may simply track the issue for the updates
a

ankushg

10/10/2018, 4:07 PM
Thanks Liliia, I'm following the issue, so if it gets updated when there's an ETA, I'll see it!
👍🏻 1
View count: 1