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

    rkeazor

    05/08/2018, 12:28 PM
    Is there any support for making network request with a multiplatform kotlin project
    🤔 1
    s
    a
    +3
    • 6
    • 8
  • j

    josephivie

    05/08/2018, 7:43 PM
    I'm constructing a temporary Gradle plugin for using reflection across all platforms. Basically, it reads your code and creates KClass implementations for everything explicitly marked, which will be accessible through something like
    MyClass::class.full
    . Any suggestions/requests/interest?
    • 1
    • 2
  • j

    josephivie

    05/09/2018, 5:47 PM
    <SOLVED> I'm having trouble getting Android Studio to recognize a module's dependencies (including the standard library) in my Gradle common project. It's odd - as far as I can tell, it's exactly the same as one of my other projects where that's all working great. Anybody have any helpful hints?
    • 1
    • 5
  • d

    drofwarcs

    05/10/2018, 9:46 PM
    A good start https://github.com/JetBrains/kotlin-native/blob/master/MULTIPLATFORM.md
    n
    • 2
    • 1
  • n

    napperley

    05/10/2018, 11:34 PM
    How is a Kotlin multi-platform library distributed/deployed ❔
    j
    s
    • 3
    • 5
  • a

    albertgao

    05/14/2018, 12:08 AM
    Am I alone?
    expectedBy
    from
    kotlin-platform-android'
    seems to cause warning:
    Warning:Configuration ‘compile’ is obsolete and has been replaced with ‘implementation’ and ‘api’.
    It will be removed at the end of 2018. For more information see: <http://d.android.com/r/tools/update-dependency-configurations.html>
    Even though I don’t know which line causes the trouble, but this is the only possible line. Anyway to fix this? Or maybe from other dependencies…
    i
    • 2
    • 2
  • r

    robstoll

    05/15/2018, 6:31 AM
    something like that: https://youtrack.jetbrains.com/issue/KT-24401#u=1526284052396
    a
    • 2
    • 1
  • p

    patjackson52

    05/17/2018, 2:10 PM
    nm, this error happens with same code in plain jvm module. I get no errors in IDE though. This is going to be a tough one 🤦
    i
    • 2
    • 1
  • b

    bissell

    05/20/2018, 6:46 AM
    Is there some step I'm missing to get
    kotlin.test
    unit tests in a common module to run in IDEA? The green arrows show up and seem clickable, but when I click them I get an error
    No JDK specified
    . If I change the common module's SDK to the JDK they will run, but this gets overwritten on any Gradle reimport. Will attach some details in a thread.
    • 1
    • 11
  • y

    yusuf3000

    05/24/2018, 11:40 AM
    Noob android developer here. I have my kotlin multiplatform project which is currently being used in an iOS project via the framework that is generated by konan. What do i do if i want to use this in an android app? Do i generate a jar file and put it in the host app?
    r
    a
    • 3
    • 4
  • y

    yusuf3000

    05/24/2018, 12:30 PM
    To expand on my above issue: In the android app where I am importing this jar file, I have 3 modules: A, B and C. B & C depend on A. The jar file is being imported into module A. Module B and A can see the types defined in the jar file, but module C cannot. Why would this be happening?
    r
    • 2
    • 1
  • f

    fabianterhorst

    05/29/2018, 4:25 PM
    talking about https://youtrack.jetbrains.com/issue/KT-20427
    😕 1
    😍 1
    i
    • 2
    • 2
  • a

    agrosner

    05/29/2018, 4:46 PM
    have the same issue. its annoying especially when all you want to do is add some constructors or methods with extra signatures in the
    actual
    implementation that differ based on each platform
    a
    • 2
    • 1
  • m

    markusa

    05/30/2018, 3:06 PM
    is there a reason why I can't have
    kotlin-test
    as an
    implementation
    dependency in a common module?
    dependencies {
        implementation "org.jetbrains.kotlin:kotlin-stdlib-common:$kotlin_version"
        implementation "org.jetbrains.kotlin:kotlin-test-common:$kotlin_version"
    }
    IntelliJ raises no error when using e.g.
    assertEquals
    , but Gradle says
    Unresolved reference: test
    Unresolved reference: assertEquals
    etc, where the first error is on the import statement for
    kotlin.test.*
    i
    • 2
    • 1
  • s

    selva

    06/01/2018, 2:33 PM
    Hi Friends, I am upgrading kotlin from 0.9.223 to 1.2.31. After upgrade i am getting an error since kotlin-time split into stdlib and stdlib-js. There is shared code used in JVM and JS modules. But having problem with compiling Date dataype. Since kotlin.js.Date works JS module and java.util.Date works in JVM module. can anyone please help me on this ? Thanks Selva
    a
    b
    • 3
    • 11
  • j

    jw

    06/04/2018, 8:12 PM
    where is "master" of the Gradle plugin? is it in the
    rr/kotlinx.serialization
    branch of the kotlin repo?
    (this was supposed to go to #serialization)
    i
    • 2
    • 3
  • l

    lex

    06/05/2018, 5:04 AM
    Hi! Does anybody get work multiplatform projects with kts? Kotlin version 1.2.41
    t
    • 2
    • 1
  • j

    josephivie

    06/12/2018, 3:39 AM
    Has anybody encountered a situation where the Android module in your common project has access to Android API 1 but nothing after that? The IDE says I have it, but when I compile it I get messages like "unresolved reference: MATCH_PARENT". No issues for things that were in API 1, though.
    • 1
    • 1
  • t

    thevery

    06/17/2018, 12:30 AM
    Ignoring common test and extending it with ios/android dummy runners works, but doesn't look like elegant solution
    r
    • 2
    • 4
  • g

    galex

    06/17/2018, 7:42 PM
    How do I use a kotlin-platform-android project (that is an android library itself) in an Android App (without deploying to a maven repo) ? It works out of the box with jars from kotlin-platform-jvm… help!
    t
    r
    b
    • 4
    • 16
  • g

    galex

    06/20/2018, 7:35 PM
    I am converted the koltin-platform-jvm one to android and I got the iOS part to build in Gradle but I have no idea how to use that project to develop a Custom View inside CLion (I guess we have to use that?)
    t
    • 2
    • 3
  • k

    kpgalligan

    06/22/2018, 3:16 PM
    First release of mutltiplatform and sqlite, with sqldelight driver. It's sort of at "take a look" stage, but is definitely functional: https://medium.com/@kpgalligan/sqlite-on-kotlin-native-9bcf47854cae
    🤩 5
    👍 4
    t
    r
    • 3
    • 4
  • l

    louiscad

    06/22/2018, 5:14 PM
    Hi, did anyone succeed in creating a multiplatform project using kotlin gradle scripts?
    b
    l
    g
    • 4
    • 37
  • g

    galex

    06/23/2018, 1:53 PM
    It seems to me that kotlin2js doesn’t convert to Javascript code that is not from its own module, correct? In that case how do we import code from a module (common-js) which implements the shared code between platforms (module common) ?
    i
    • 2
    • 6
  • r

    robstoll

    06/23/2018, 6:37 PM
    I lately have the problem (since I update to 1.2.50) that running speks sometimes do not pick up new code. I have checked "Delegate run/build to gradle". But it seems that not the code from gradle is taken up but some old code. Do others have this problem as well?
    e
    • 2
    • 2
  • g

    galex

    06/25/2018, 11:26 AM
    In a MPP setting, did you manage to build an iOS app with AppCode, or are you using Xcode? How do you work on the kotlin/native code (to have autocompletion, imports iOS kotlin classes, etc) ?
    k
    • 2
    • 1
  • j

    juliocbcotta

    06/26/2018, 12:08 AM
    So.. suppose I have a lib written using just kotlin (I think) classes... what should I do if I want to make it available for JS? I plan to release it as a maven artifact and found some docs of how to do it... is there any problem if the kotlin/java plugins are applied together with the js plugins?
    g
    c
    • 3
    • 10
  • j

    jdemeulenaere

    06/27/2018, 12:34 PM
    Is there a way to get the current call stack in Kotlin common code ? Something similar to currentStackTrace() on the JVM. I'd like to know the class and method name of the caller of a function. Thanks 🙂
    s
    l
    r
    • 4
    • 8
  • r

    Ruckus

    06/29/2018, 7:42 PM
    Is there any plan to open up the multiplatform concept to let people create their own compile targets? Or even just some helpers for Kotlin transpiling (something like what is used for Kotlin/JS)?
    g
    l
    • 3
    • 6
  • e

    Edouard Goossens

    07/03/2018, 9:32 PM
    Hi everyone, I’m trying to extract common code for my app’s data (models, basically just Kotlin data classes) and repository layers. 1/ I’d like to have the data layer available in iOS as a framework generated with Konan, and as a direct dependency in other platforms. I don’t have “expect” declarations there so maybe there’s a way to handle this without multiplatform? 2/ I’d like to share the repository logic (HTTP and Firebase) between the backend (Ktor/JVM), Android and later React JS apps. As I’m going to use specific libraries in each platform for HTTP and Firebase I want to use the expect/actual mechanism here. I’d also like to use Kotlin serialization and coroutines as much as possible. iOS will still have it’s own repository layer written in Swift until Multiplatform supports Kotlin/Native better. Does this make sense? Has anyone done something similar? How can I make the repository layer depend on the data layer? Thanks!
    k
    • 2
    • 2
Powered by Linen
Title
e

Edouard Goossens

07/03/2018, 9:32 PM
Hi everyone, I’m trying to extract common code for my app’s data (models, basically just Kotlin data classes) and repository layers. 1/ I’d like to have the data layer available in iOS as a framework generated with Konan, and as a direct dependency in other platforms. I don’t have “expect” declarations there so maybe there’s a way to handle this without multiplatform? 2/ I’d like to share the repository logic (HTTP and Firebase) between the backend (Ktor/JVM), Android and later React JS apps. As I’m going to use specific libraries in each platform for HTTP and Firebase I want to use the expect/actual mechanism here. I’d also like to use Kotlin serialization and coroutines as much as possible. iOS will still have it’s own repository layer written in Swift until Multiplatform supports Kotlin/Native better. Does this make sense? Has anyone done something similar? How can I make the repository layer depend on the data layer? Thanks!
k

krtko

07/06/2018, 5:04 AM
Yes this is possible and I have done it with the JVM, Android, and the web. I haven't tried out Kotlin Native and iOS yet as its still alpha.
It can be kinda tricky at first structuring your API to be able to adapt to each platform
View count: 1