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

    benleggiero

    03/24/2018, 4:12 AM
    Sorry to muck up this channel with beginner stuff, but #getting-started has been silent. Can anyone help me with this?
    s
    • 2
    • 1
  • j

    jw

    03/24/2018, 10:03 PM
    see #ktor
    n
    s
    • 3
    • 2
  • k

    karelpeeters

    03/24/2018, 10:03 PM
    Might be part of #ktor when it becomes fully multi-platofrm
    n
    • 2
    • 1
  • y

    yusuf3000

    03/25/2018, 1:10 PM
    I’ve got a
    import platform.UIKit.*
    at a top of a kotlin file in my iOS module of my multiplatform project, but i’m getting an unresolved reference when gradle runs
    :platforms:ios:compileKonanTest-libraryMacbook
    . I’ve looked online and can’t see where I’m going wrong.
    i
    s
    • 3
    • 2
  • e

    Evgeniy Zaharov

    03/26/2018, 7:54 AM
    like lite version of Scala’s macros?
    d
    • 2
    • 1
  • g

    gildor

    03/26/2018, 8:22 AM
    Do you use platform plugin? for example
    kotlin-platform-jvm
    instead of
    kotlin
    in Gradle?
    y
    g
    +2
    • 5
    • 26
  • p

    prasham.h.trivedi

    03/27/2018, 12:52 PM
    I have stuck in multiplatform + android instant app module setting. I have 4 modules as of now. 1. Common Module 2. Feature Module which also serves as platform module with
    kotlin-platform-android
    3. App Module 4. Instant App Module https://gist.github.com/PrashamTrivedi/7e0837756a6b6e0503e9eb26b739fe0c Here is my stripped down gradle setup. Problem is: Common data is not considered as module. What am I doing wrong?
    q
    • 2
    • 11
  • j

    joseph_ivie

    03/29/2018, 9:15 PM
    Native included? Sweet! Edit: Native is still in the works
    r
    • 2
    • 1
  • j

    jw

    03/29/2018, 9:31 PM
    one might even call it -2
    r
    • 2
    • 1
  • y

    yusuf3000

    04/02/2018, 1:52 PM
    At the bottom it says:
    Soon we will show you how you can use fully featured mocking library MockK in common modules.
    . Is there an update on this that anyone knows of? Or does anyone know how to do this already?
    m
    a
    • 3
    • 3
  • q

    qlitzler

    04/03/2018, 7:08 PM
    Sadly in my multiplatform project (an app for Android and iOS), I had to ultimately forego the use of kotlin multiplatform for shared logic, because of the lack of generics conversion from Kotlin to Swift. I’ll have to be patient until it is implemented 🙂
    s
    • 2
    • 9
  • g

    gildor

    04/05/2018, 2:03 PM
    Check your imports, that there is no java version of RuntimeException (java.lang.RuntimeException)
    y
    • 2
    • 4
  • l

    louiscad

    04/08/2018, 1:51 PM
    Hi, is Kotlin multiplatform compatible with Kotlin gradle scripts (
    .kts
    )? When creating a new project, selecting "Kotlin DSL build script" hides all multiplatform options.
    :yes: 1
    l
    • 2
    • 1
  • s

    spierce7

    04/11/2018, 5:12 AM
    I'm using the
    1.2.40-eap-51
    , and I can't seem to access any kotlin stdlib helper functions in my common module. i.e. I can't access
    listOf()
    . Is this a known issue? I'm in Android Studio 3.1.1. I also can't manually import the functions like I used to be able to do in previous versions.
    i
    • 2
    • 2
  • w

    wickedev

    04/11/2018, 6:57 AM
    https://github.com/Kotlin/kotlinx.dom is not maintain anymore?
    🤔 1
    l
    s
    +2
    • 5
    • 12
  • k

    kpgalligan

    04/15/2018, 3:17 AM
    It's possible that I'm implementing this wrong (very possible), but have a question about typealias. For ios multiplatform I have interop class definitions that are close but not exact enough to work as actual typealias definitions. I got really excited about using extension functions, but hopes dashed when those don't seem to be included in the definition for actual classes. Is this supported, and if not, thoughts? Right now I'm creating delegate classes. Works, but verbose.
    r
    • 2
    • 4
  • k

    kpgalligan

    04/15/2018, 3:18 AM
    @agrosner Hey! Working on a sample or porting dbflow to multiplatform?
    a
    • 2
    • 7
  • d

    diesieben07

    04/15/2018, 9:07 PM
    I had a lot of trouble getting that to work, mostly because of
    actual typealias
    not working correctly yet. That makes it impossible to use e.g.
    UUID
    in your domain objects.
    l
    • 2
    • 8
  • c

    christophsturm

    04/16/2018, 8:13 AM
    what is the difference between the official multiplatform support and just manually compiling the same kotlin source once for the jdk and once for js?
    g
    l
    • 3
    • 3
  • i

    ilya.gorbunov

    04/16/2018, 8:48 PM
    That's a known issue with
    JvmName
    annotation type aliases: https://youtrack.jetbrains.com/issue/KT-22902 Try declaring a type alias with the same short name:
    actual typealias JvmName = kotlin.jvm.JvmName
    k
    • 2
    • 1
  • a

    agrosner

    04/21/2018, 8:56 PM
    I guess I could add the project as a source set to both the Android + java pieces
    i
    • 2
    • 1
  • s

    snrostov

    04/23/2018, 11:58 AM
    @agrosner since 1.2.40 you can do something like this:
    my-common: common
    	my-jvm: common, compile("my-common")
    		my-jvm-android: jvm, expectedBy(":my-jvm"), expectedBy(":my-common")
    		my-jvm-server: jvm, expectedBy(":my-jvm"), expectedBy(":my-common")
    	my-js: js, expectedBy(":my-common")
    a
    • 2
    • 1
  • a

    agrosner

    04/23/2018, 12:31 PM
    when you compile another common library A that has expects and B is a common module that depends on A, do those expects carry over from A and can you partially implement those expects in B?
    i
    g
    • 3
    • 11
  • a

    andreasmattsson

    04/24/2018, 3:02 PM
    would anyone be able to assist me in figuring out what my
    expect
    declaration should look like in order to be able to use the following (delegating to Gson) type annotation on my (cross-platform/shared) data models:
    actual typealias SerializedName = com.google.gson.annotations.SerializedName
    this:
    expect annotation class SerializedName(val value: String, val alternate: Array<String> = [])
    results in error:
    Parameter 'alternate' has conflicting values in the expected and actual annotation
    g
    • 2
    • 3
  • a

    araqnid

    04/27/2018, 12:37 PM
    We're trying to convert a small app to be multiplatform -- one issue we're encountering is that in IntelliJ, the JVM platform module has dependencies on build kotlin-stdlib and kotlin-stdlib-common, which causes things like
    buildSequence
    to be unusable. It seems this happens just in a simple multiplatform template project too -- does anyone else get this? (currently working around by manually removing kotlin-stdlib-common from the project structure, which is a pain)
    i
    l
    • 3
    • 15
  • e

    Evgeniy Zaharov

    04/28/2018, 9:37 AM
    Does it possible to use
    expectedBy
    declaration with
    library
    ? Or if no, then the question is how we could implement (in platform modules) common declaration from common dependencies?
    i
    • 2
    • 7
  • e

    egorand

    04/28/2018, 2:37 PM
    looks like
    internal
    members inside the common module aren’t visible in platform modules, is there a way around it? I want to store my utils in the common module, but don’t want them to be exposed as API
    q
    i
    • 3
    • 4
  • r

    robstoll

    05/05/2018, 11:56 AM
    I am struggling with StringBuilder. I have a common module which uses StringBuilder but I cannot call the function from the JVM module since
    java.lang.StringBuilder
    does not seem to be the actual type of it. What is the actual type in JVM?
    k
    k
    • 3
    • 16
  • h

    hannesstruss

    05/06/2018, 7:47 AM
    Has anyone looked into porting threetenbp to Kotlin common/multiplatform? Would that be a good idea? 🤔
    ➕ 1
    👍 1
    g
    l
    • 3
    • 2
  • t

    trathschlag

    05/07/2018, 9:20 AM
    Hi, when I define two multiplatform projects like this:
    utils
        - common -> define Foo.class
        - jvm
        - js
    
    app
        - common
        - server : utils-jvm -> use Foo.class
        - client : utils-js
    And
    app
    includes
    utils
    as a composite build in gradle with
    includeBuild
    then IDEA marks any use of Foo.class in
    app-server
    as not found. Gradle builds everything perfectly fine, so is this a bug in IDEA?
    r
    i
    • 3
    • 8
Powered by Linen
Title
t

trathschlag

05/07/2018, 9:20 AM
Hi, when I define two multiplatform projects like this:
utils
    - common -> define Foo.class
    - jvm
    - js

app
    - common
    - server : utils-jvm -> use Foo.class
    - client : utils-js
And
app
includes
utils
as a composite build in gradle with
includeBuild
then IDEA marks any use of Foo.class in
app-server
as not found. Gradle builds everything perfectly fine, so is this a bug in IDEA?
I also found https://youtrack.jetbrains.com/issue/KT-23302. Is it the same problem?
r

robstoll

05/07/2018, 9:29 AM
have delegated run/build to gradle?
t

trathschlag

05/07/2018, 12:45 PM
Yes that was already enabled
Ok I found out that this only happens if app-server also has a dependency on app-common. If you don't have this dependency, IDEA seems to find the Foo.class.
r

robstoll

05/07/2018, 1:28 PM
good to know
t

trathschlag

05/07/2018, 2:42 PM
The problem seems to be introduced in the kotlin-gradle-plugin from 1.2.31 to 1.2.40
i

ilya.gorbunov

05/07/2018, 3:47 PM
@trathschlag I'm not sure we support composite gradle builds with multiplatform project yet. Please report your problem to the tracker so we could investigate it.
t

trathschlag

05/07/2018, 3:47 PM
Just did that 🙂 https://youtrack.jetbrains.com/issue/IDEA-191529 Thanks!
View count: 1