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

    Andy Gibel

    10/31/2019, 6:22 PM
    is anyone using OpenAPI Swagger codegen in a KMPP project?
    k
    m
    a
    • 4
    • 12
  • s

    Sylvain Patenaude

    10/31/2019, 8:47 PM
    When targeting Android, is it preferred to use 'jvm' or 'android' as a target? From what I've read, 'jvm' seems to do the job, so any need to go native with the 'Android' target?
    d
    k
    • 3
    • 6
  • t

    Tony

    11/01/2019, 1:05 PM
    in kotlin native, can we use NSURL for the network stack? (trying to find ktor alternative)
    o
    s
    • 3
    • 11
  • k

    kpgalligan

    11/01/2019, 3:13 PM
    Anybody have a reasonably current post on deploying with bintray?
    👍 1
    s
    k
    +3
    • 6
    • 14
  • b

    bod

    11/01/2019, 7:29 PM
    Hello, World! I'd like to generate a small file and include it to the common sourceset. In 'normal' (non multiplatform) projects, I have been doing this this way:
    // Create a Version.kt file and add it to the source set
    task generateSources {
        def outputDir = file("$buildDir/generated/source/kotlin")
        outputs.dir outputDir
        doFirst {
            def outputWithPackageDir = new File(outputDir, "com/example/mylib")
            outputWithPackageDir.mkdirs()
            new File(outputWithPackageDir, "Version.kt").write("package com.example.mylib\ninternal const val VERSION = \"$project.version\"")
        }
    }
    compileKotlin.dependsOn generateSources
    compileKotlin.source += generateSources.outputs.files
    But that doesn't work in my multiplatform module. I've tried to replace
    compileKotlin
    by
    compileKotlinCommon
    but doesn't work either. Ideas?
    h
    • 2
    • 4
  • s

    sngrekov

    11/02/2019, 3:12 PM
    Are there any MPP libraries with implementation for Queue, Stack and Deque?
    a
    • 2
    • 2
  • a

    Alexander Minyaev

    11/03/2019, 5:14 AM
    Hello! How to connect mpp-module to js-module? Description my problem here:https://stackoverflow.com/questions/58677550/how-to-connect-multiplatform-module-to-js-module-with-gradle
    e
    • 2
    • 2
  • j

    Jérôme Gully

    11/03/2019, 1:53 PM
    Hi, I plan to participate to the Github annual Game Jam, and with my team we want to try Kotlin multi-platform to make the game running on Android, iOS and Web. I'm a bit lost about the way to create and configure the project into intellij, betweens Multiplatform library or mobile Android/iOS. The first is just a shared library and the other seems to generate the project for android and ios (very nice, but can I add web too ?)
    d
    • 2
    • 4
  • d

    Dmitri Sh

    11/03/2019, 6:22 PM
    What's the status on watchOS target? Looks like 1.3.60 will support it (https://github.com/JetBrains/kotlin-native/blob/671da8181cb729dca449cc597dc6c89d4f429b73/CHANGELOG.md) ? Will there be a sample project published?
    m
    a
    • 3
    • 7
  • h

    hallvard

    11/03/2019, 9:41 PM
    Is there a known problem with defining extension functions within files that have expect/actual stuff? I get a
    Duplicate JVM class name
    error from gradle when trying to build (and if I move my extension function to a file that has no
    expect
    functions, everything is hunky dory).
    k
    s
    d
    • 4
    • 11
  • k

    Konstantin Petrukhnov

    11/04/2019, 6:58 AM
    Is there any guide how to try kn/mpp 1.3.70-dev-972? I got error: Plugin [id: 'org.jetbrains.kotlin.multiplatform', version: '1.3.70-dev-972'] was not found in any of the following sources:
    s
    m
    • 3
    • 26
  • k

    kpgalligan

    11/04/2019, 10:22 AM
    Does anybody know if there are 1.3.60-eap-76 versions of ktor and serialization?
    a
    • 2
    • 5
  • b

    bod

    11/04/2019, 4:17 PM
    Hello, World! I'm trying to import my lib as a .framework into XCode and it appears to be done correctly (it's listed in "frameworks"), but
    import name_of_my_lib
    gives "No such module". Any idea?
    a
    • 2
    • 9
  • t

    Tony

    11/04/2019, 4:50 PM
    Does anyone know how to get a CPointer<ByteVar> out of a NSData object?
    d
    • 2
    • 1
  • k

    Kris Wong

    11/04/2019, 5:09 PM
    is anyone using kodein successfully in a multiplatform library w/ K/N?
    k
    o
    k
    • 4
    • 23
  • b

    bod

    11/05/2019, 10:27 AM
    Hello, World! When using a kotlin mpp module exported as an iOS Framework, all
    suspend
    functions seem to be not visible from swift. I suppose this is a known limitation? Is there an official documentation about this?
    a
    r
    j
    • 4
    • 14
  • s

    Sylvain Patenaude

    11/05/2019, 2:27 PM
    Context: I'm developing a Kotlin MP API (or SDK) targeted for Android/iOS. The project includes the common code (MP) and probably some platform-specific code (Android/iOS). It doesn't include client apps, as the consumers would import the generated native libraries from outside this project. Based on this, would you have only one build.gradle file (with the appropriate targets/sourceSets) or would you rather have many: for instance, one main in the parent project and others for "child" modules (Android, iOS and possibly 'common')? For now I have only one at project (root) level. Thanks in advance.
    k
    • 2
    • 8
  • s

    Sylvain Patenaude

    11/05/2019, 4:22 PM
    Anyone has a web reference link to the API of tasks such as framework below? I'm not sure if I should keep framework() without parameters or if I should pass my project/module name as a parameter? kotlin { jvm() // This is for iPhone emulator // Switch here to iosArm64 (or iosArm32) to build library for iPhone device iosX64("ios") { binaries {
    framework()
    } } Edit: If I use
    framework('MySDK')
    , I get a gradle error
    Key debugFramework is missing in the map.
    .
    a
    • 2
    • 6
  • e

    etolstoy

    11/05/2019, 4:27 PM
    Hi everyone! Can you share your experience working with
    xcodeproj
    in your mobile MPP projects? We’re interested in three questions: 1. What changes in
    xcodeproj
    you make on an ad hoc basis? 2. What changes you make regularly on a daily or weekly basis? 3. Are there any cases when you have to duplicate some settings both in gradle file and in
    xcodeproj
    ? Thanks a lot in advance ❤️
    🍎 2
    🔥 3
    s
    b
    • 3
    • 3
  • s

    Sylvain Patenaude

    11/05/2019, 7:31 PM
    My settings.gradle file currently looks like this:
    rootProject.name = 'MySDK'
    include 'MySDK'
    enableFeaturePreview('GRADLE_METADATA')
    It's based on examples, but I'm struggling to fully grasp what the rootProject.name implies (what are its effects?). Same thing for the include statement. Any documention on this somewhere?
    d
    • 2
    • 2
  • j

    James

    11/06/2019, 6:59 AM
    Can anyone solve this issue?
    n
    k
    • 3
    • 2
  • n

    nrobi

    11/06/2019, 7:12 AM
    I have the following expected class in my common and I’d like to have different actual db implementations for 🍏 and :android:. I know, that I can’t expose `Flow`s to iOS. Is there any way to use streams somehow? The only solution I can see currently is to have an abstracted stream, with the actual implementations specified in the platform modules. Any better ideas? 🙏
    Untitled
    j
    • 2
    • 2
  • f

    Frank Feng

    11/06/2019, 11:50 AM
    Anyone encounter this error?
    Compiler Log
    s
    • 2
    • 1
  • t

    Tony

    11/06/2019, 7:56 PM
    Hi all, does iOS treat Kotlin companion objects as a class method?
    🇳🇴 1
    k
    • 2
    • 4
  • j

    Jérôme Gully

    11/06/2019, 8:06 PM
    I don't find any documentation for the browser() part, what is the purpose to adding it into js{ } ?
    Sans titre
    s
    • 2
    • 2
  • j

    Jan Stoltman

    11/07/2019, 10:40 AM
    Hey guys, do builds for your Kmp projects take much longer than for pure android/ios stuff? I'm facing a problem where clean build of my somewhat big project takes up to 11min, and so I'm wondering whether this is normal or not
    k
    • 2
    • 4
  • m

    magnumrocha

    11/07/2019, 2:06 PM
    is it the same of that: https://youtrack.jetbrains.com/issue/KT-31984 ?
    a
    • 2
    • 4
  • k

    Konstantin Petrukhnov

    11/07/2019, 2:36 PM
    Does anyone have example of sonarqube config for mpp? Can't find what need to put to sources.
    k
    • 2
    • 3
  • n

    Nikita Khlebushkin

    11/07/2019, 3:31 PM
    Hello there! What is the roadmap for Kotlin Multiplatform? Is it realistic to expect it stable in production within a year?
    🤔 1
    k
    s
    +2
    • 5
    • 6
  • n

    Nikita Khlebushkin

    11/07/2019, 4:08 PM
    And another question: what are the plans about Codable protocol (Swift specific) support? Will it be resolved at some point or should I look for workarounds? (If the latter is correct, are there any examples of how it can be addressed)?
    s
    d
    s
    • 4
    • 8
Powered by Linen
Title
n

Nikita Khlebushkin

11/07/2019, 4:08 PM
And another question: what are the plans about Codable protocol (Swift specific) support? Will it be resolved at some point or should I look for workarounds? (If the latter is correct, are there any examples of how it can be addressed)?
s

Sam

11/07/2019, 4:28 PM
Codable is a Swift only protocol and not visible from ObjC interop.
NSCoding
is the ObjC version of
Codable
.
n

Nikita Khlebushkin

11/07/2019, 7:17 PM
My bad, sorry, I fixed the question. What I mean is is there a way to add Codable to the models when running from Swift?
s

Sam

11/07/2019, 7:33 PM
How about in your Swift file?
extension MyKotlinClass: Codable {}
The compiler may not be able to generate the actual code, in which case you'll need to add the methods
encode(to encoder: Encoder)
and
init(from decoder: Decoder)
n

Nikita Khlebushkin

11/07/2019, 8:11 PM
If I understood you correctly, then it is something that I am trying to avoid: I am creating a shared library for iOS and Android, mostly consisting of models. Creating an extending class for each model is kind of killing all the joy
d

Dmitri Sh

11/08/2019, 1:22 AM
nope it shouldn't kill all the joy. it is an extension on that, perfectly decoupled. but why would you want codable when kotlinx serializable works just fine in iOS if you're using ktor client
n

Nikita Khlebushkin

11/08/2019, 8:33 AM
@Dmitri Sh The thing is that I don't use ktor (and tbh I don't want to change the project's api framework just because it's a dependency of kotlin-multiplatform)
d

Dmitri Sh

11/09/2019, 5:19 AM
ok, that's fair. Still, I think a swift extension is perfectly fine. That's what I did for Identifiable (for my common models to be compatible with SwiftUI list requirement) and I don't feel this feels out of place.
s

svyatoslav.scherbina

11/11/2019, 9:11 AM
AFAIK, kotlinx.serialization works just fine even without ktor client.
View count: 8