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

    Matej Drobnič

    07/28/2019, 7:46 PM
    Are there any map synchronization primitives available for kotlin multiplatform?
    a
    k
    18 replies · 3 participants
  • m

    Matej Drobnič

    07/28/2019, 7:46 PM
    There is
    io.ktor.util.collections.ConcurrentMap
    but it appears internal to ktor
    k
    6 replies · 2 participants
  • m

    Matej Drobnič

    07/28/2019, 7:47 PM
    or maybe just general synchronization / mutex?
    k
    1 reply · 2 participants
  • a

    adiba

    07/29/2019, 10:25 AM
    Has anyone used klock recently and using the TimeProvider in tests?
    c
    2 replies · 2 participants
  • k

    Kris Wong

    07/30/2019, 3:56 PM
    er... NSIndexPath binding seems to be missing all of it's useful properties
    1 reply · 1 participant
  • v

    vmichalak

    07/31/2019, 11:58 AM
    Has anyone found a solution to shared share the permission request (GPS, Notifications, ...) between iOS and Android ?
    l
    2 replies · 2 participants
  • c

    carlos cdmp

    07/31/2019, 1:04 PM
    Is anyone using coroutines succesfully in iOS? Im looking for an
    actual
    implementation for the Main and IO Dispatcher
    r
    s
    +3
    17 replies · 6 participants
  • k

    Kris Wong

    07/31/2019, 4:19 PM
    is there anything that can be done within IDEA to prevent it from showing errors related to iOS SDK bindings that are caused by "overlapping" method signatures (it shows as an incorrect return type)?
    t
    s
    11 replies · 3 participants
  • m

    Mike Wolfson

    07/31/2019, 5:17 PM
    Hi folks...I am running a Kotlin Everywhere in September, and was hoping to support a multi-platform codelab. I am an Android dev, and was hoping to do a simple iOS to Android multiplatform codelab but don't know of any online...does anybody have a suggestions for the simplest tutorial, or codelab I can find for this? FWIW, the codelabs supplied by Google and Jetbrains for K\E are "Intro to Kotlin Native" and then "Kotlin\JVM and Kotlin\JS). I want to show sharing simple business logic between and iOS and an Android client, would love a super simple codelab/example of this.
    m
    k
    +3
    20 replies · 6 participants
  • k

    Kris Wong

    07/31/2019, 6:08 PM
    has anyone figured out how to test a view controller subclass implemented in kotlin MPP?
    s
    14 replies · 2 participants
  • j

    josephivie

    07/31/2019, 8:14 PM
    I'm nearly done with a full multiplatform UI library that spans Android, Web, iOS, and JavaFX, with the potential for more available. One of the last things left is common icons - for example, having a common back button icon available is really convenient. They need to be vectors images. I'm stuck between the ideas of using FontAwesome on all platforms or supporting SVGs, where I have every platform but iOS doing fairly well already. However, when it comes to implementing SVGs on iOS, just importing a cocoapod isn't easy, and I'm not sure what the interactions of it with pushing the library to Maven are. I'm not insane enough to write my own full-blown SVG renderer in K-N, but I think I could do one that supported only the
    path
    element fairly easily. Between path-only SVGs (material icons) and FontAwesome, which would you prefer? Or do you think you can tell me enough to get a cocoapod fully integrated with a K-N library that will be pushed up to and consumed from maven?
    c
    l
    +1
    4 replies · 4 participants
  • p

    Patrick Jackson

    08/01/2019, 4:29 PM
    Not that I know of. publishing the kotlin artifacts to Maven is pretty straight forward and works with the maven-publish plugin. A good example is Multiplatform-settings or Sql-delight. Should be able to c/p and change the relavent parts. As for publishing js to npm, I haven't seen any sort of integration with KMP. I imagine there is a gradle plugin for that but I have not looked into it.
    r
    k
    12 replies · 3 participants
  • u

    4ntoine

    08/01/2019, 7:50 PM
    Hey, guys. What’s the suggested way to access (read/write) files in K/M? I thought
    kotlin-io
    was created for it (not for, but including it), but now i’m a bit confused. Let’s say i need only jvm, and linux/mac targets support only
    d
    6 replies · 2 participants
  • a

    adiba

    08/02/2019, 10:54 AM
    Has anyone been able to properly configure klock library for a multi platform project (iOS & Android). If so, please could you post your setup below. Would be greatly appreciated.
    1 reply · 1 participant
  • k

    Kirill Shmakov [JB]

    08/02/2019, 12:05 PM
    Dear community, In our new EAP Kotlin plugin (1.3.50-eap-54) we have supported basic Run/Debug functionality for Kotlin/Native executables. It is available in IDEA Ultimate 192 provided a plugin “Native Debug for Intellij” is installed. Kotlin plugin will automatically create IDE run configuration for each executable in your MPP project. In these configurations one could specify program arguments, environment variables and working directory. Each configuration could be run with either debug or release binary. If you update your MPP plugin in your project to the latest version (
    id 'org.jetbrains.kotlin.multiplatform' version '1.3.50-eap-54'
    or `kotlin("multiplatform") version "1.3.50-eap-54"`; see template Idea project for
    build.gradle.kts
    and
    settings.gradle.kts
    examples), you would be able to set breakpoints (choose
    Line Breakpoint
    in dialog) in your project as well. The feedback is much appreciated. Kotlin plugin: https://plugins.jetbrains.com/plugin/6954-kotlin/update/66397 nativeDebug plugin: https://plugins.jetbrains.com/plugin/12775-native-debug-for-intellij
    🎉 22
    🔥 10
    🤘 6
    👍🏼 10
    👏 1
    🙌 3
    k
    l
    +1
    9 replies · 4 participants
  • v

    vlad.minaev

    08/02/2019, 12:59 PM
    Are there any multiplatform libraries for seamless client-server communication (i.e. which abstracts from creating http endpoints and manual server querying)
    d
    c
    +1
    26 replies · 4 participants
  • t

    tylerwilson

    08/02/2019, 4:29 PM
    It might be fun to share our real world experiences with multiplatform. I may complain and ask a lot of questions, but I have used the tech to great effect thus far: I have one shared library/framework used in 3 different iOS apps and 2 different Android apps, all in production. This includes maybe 12 different models and 20 APIs thus far (and I am not even half way to wrapping them all). I have a wrapper on Android that converts standard callback to Kotlin Result, and a wrapper on iOS side that converts the callbacks to Swift Result type (with some misc. Swift extensions to make things more Swift like). The major issues I have are around testing and switching between IntelliJ, Android Studio and AppCode and generally learning gradle well enough to be useful. But I am optimistic these wrinkles will be smoothed out and more and more of our logic will be moved into this shared code area (perhaps even one day be used from JS).
    🌶️ 3
    k
    j
    +3
    34 replies · 6 participants
  • p

    Patrick Jackson

    08/02/2019, 7:25 PM
    anyone know how to add a dependency to a specific configuration of a KMP module? i.e. in android module I want to use a certain configuration from the common module in a specific buildflavor Thought it would be along the lines of:
    implementation project(path: ':common', configuration: 'mock')
    t
    4 replies · 2 participants
  • w

    wuseal

    08/04/2019, 1:52 PM
    Hi,Everyone, Could I simply this gradle kotlin dsl of MPP project?
    d
    2 replies · 2 participants
  • w

    wuseal

    08/04/2019, 2:03 PM
    I Meet a building problem in XCode when I change the MPP module name from app to mpplib, Anyone could give some tips for me ?
    1 reply · 1 participant
  • w

    wuseal

    08/04/2019, 3:30 PM
    Anyone Know how to migrate Gradle groovy code
    api project(':mpplib')
    to kotlin DSL Code?🙂
    1 reply · 1 participant
  • r

    Robert Jaros

    08/04/2019, 5:29 PM
    Is it possible to run gradle build for a single, selected platform (without commenting multiplatform buildfile)? Any command line option?
    d
    6 replies · 2 participants
  • g

    gumil

    08/04/2019, 7:10 PM
    Did anyone encounter
    Configuration with name 'compileClasspath' not found
    when running android lint on a project depending on a multiplatform project?
    r
    2 replies · 2 participants
  • m

    Marko Mitic

    08/05/2019, 9:03 AM
    Latest version of
    okio
    added mutliplatform support, if someone is interested in changes - https://github.com/square/okio/compare/2.2.2...parent-2.3.0
    👍 3
    w
    d
    8 replies · 3 participants
  • a

    adiba

    08/06/2019, 11:02 AM
    Working through some assumptions that I have in my head. Are the following correct? 1. It is possible to have a KotlinMPP where the common code can be split into several sub modules which compile into a single framework for an iOS app 2. It is not possible for an iOS app to use multiple frameworks at this time (e.g generated from multiple KotlinMPP projects)
    :yes: 1
    a
    s
    3 replies · 3 participants
  • k

    Konstantin Petrukhnov

    08/06/2019, 12:01 PM
    Is it possible to build multiplatform project, so it compiles to jar and js, where js will be run on iOS and loaded during runtime. Goal would be to update part of ios app without pushing new version to appstore. No dependent libs except kotlin itself. Maybe there is already example?
    d
    s
    5 replies · 3 participants
  • w

    wuseal

    08/06/2019, 3:23 PM
    If I need to get kotlin_version value in
    build.gradle.kts
    from
    gradle.properties
    file, I can get the value by
    val kotlin_version: String = property("kotlin_version").toString()
    but can’t by
    val kotlin_version: String by properties
    . WHY?😂 , Anybody could tell me?
    m
    b
    3 replies · 3 participants
  • s

    Slackbot

    08/08/2019, 3:42 AM
    This message was deleted.
    e
    1 reply · 2 participants
  • s

    saket

    08/08/2019, 3:48 AM
    Does anyone have/know of a project that targets both Android and macOS and has a GUI? It'd be nice to have a reference.
    u
    k
    +1
    16 replies · 4 participants
  • v

    Vishal

    08/08/2019, 5:00 AM
    I'm new to kotlin, and created a sample Multiplatform application(common code will be shared between Android and IOS) using https://kotlinlang.org/docs/tutorials/native/mpp-ios-android.html#creating-an-android-project reference. Everything is working fine, now i need to write common code for calling graphql API that can be used from both Android and IOS. Can anybody help?
    k
    s
    +3
    27 replies · 6 participants
Powered by Linen
Title
v

Vishal

08/08/2019, 5:00 AM
I'm new to kotlin, and created a sample Multiplatform application(common code will be shared between Android and IOS) using https://kotlinlang.org/docs/tutorials/native/mpp-ios-android.html#creating-an-android-project reference. Everything is working fine, now i need to write common code for calling graphql API that can be used from both Android and IOS. Can anybody help?
k

kpgalligan

08/08/2019, 12:43 PM
I would start with a newer tutorial. That is quite old. I’m not sure what the best/most current one is. We have one in the queue that’s essentially “get started in 5 minutes” for native mobile. Need to check with the team on where that is and may be able to share that a little later.
For graphql, there is no multiplatform library (that I’m aware of). You’ll need to construct the calls manually and use ktor (or similar).
s

saket

08/08/2019, 12:45 PM
TIL the official guide is old
k

kpgalligan

08/08/2019, 12:48 PM
Well, one of the official guides is old. That’s last kotlinconf, which in KMP terms is pretty old. Try this: https://kotlinlang.org/docs/tutorials/native/mpp-ios-android.html
Wait, weird!
That’s really odd
Never mind. Seems hard to believe, but either something really strange is happening server side, or I had a really old cached version (and this laptop is newer than Oct 2018). In any case, it’s not as old as it appeared.
The content I was seeing was old, though. Talking about 1.3.21, etc
s

saket

08/08/2019, 1:31 PM
Interesting. I'm still seeing 1.3.21 on my side. Let me check another browser.
Yep, it is a caching issue. Thanks for the headsup Kevin!
k

kpgalligan

08/08/2019, 1:33 PM
Weird, right?
I think if you saw that and I saw that, either they just updated it, or something on the back end wasn’t working
v

Vishal

08/08/2019, 3:34 PM
Hi @kpgalligan can you help me with creating a multiplatform library for calling graphql API that can be used by both IOS and Android
k

kpgalligan

08/08/2019, 3:38 PM
I have zero graghql experience. You’ll either need to create your own server calls, or try to expect/actual apollo android and ios (or something similar). Not sure that’s possible, though. If apollo does code gen, expect/actual may be difficult.
v

Vishal

08/08/2019, 3:43 PM
@kpgalligan but apollo is only for android and i want something that can be used by both IOS and Android
@saket but ktor is kotlin library for calling the graphql APIs from android only, right? how can i achieve something which can be used by both Android and IOS
k

kpgalligan

08/08/2019, 3:48 PM
ktor is multiplatform
v

Vishal

08/08/2019, 3:50 PM
yes but only for http call, what about graphql?
k

kpgalligan

08/08/2019, 3:54 PM
You need to either create your graphql calls manually with ktor, or try to expect/actual with apollo android and iOS. There is no multiplatform graphql library. I mean, that’s the answer. Creating a multiplatform version of apollo is something we’re discussing (quite literally right now), but if that happens it’ll be a while.
y

yshrsmz

08/09/2019, 9:49 AM
GraphQL is just a http POST, so you can do it manually if you choose. FYI this is my attempt to create Kotlin wrapper for GraphQL reequest body https://github.com/yshrsmz/kgql
d

Dominaezzz

08/09/2019, 3:03 PM
I'm working on a graphql kotlin generator thingy magick but don't hold your breath.
k

kpgalligan

08/09/2019, 3:13 PM
If I get time I’m going to start looking at apollo, but not sure we’re actually going to dive into implementing that. There’s been talk about it recently: https://github.com/apollographql/apollo-android/issues/1455
👍 1
r

russhwolf

08/09/2019, 4:01 PM
Poking in late but I hadn't seen that the MPP Android/iOS tutorial had updated. Loving that the update date is two days from now 🙃
🤣 1
s

saket

08/09/2019, 4:09 PM
It's from the future, just like Kotlin Multiplatform.
k

kpgalligan

08/09/2019, 6:25 PM
Something’s up with the dates and caches. Assuming the site runs on kotlin, need a solid date library!
🤣 1
View count: 3