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

    gbasile

    06/21/2021, 9:53 AM
    Hello KMM community 👋 I was exploring KMM for a project that will be Android/iOS/Desktop/(and maybe web) and I would like to understand if it’s possible to have multiple feature modules instead of a single one. Any recommended reading?
    a
    • 2
    • 2
  • r

    Rak

    06/21/2021, 10:20 AM
    I added a default parameter to my method signature and the iOS side does not compile - I take it its not supported?
    @Throws(Throwable::class)
        suspend fun getConfig(jwt: String? = null): String {
    Any work arounds?
    k
    • 2
    • 3
  • h

    Hossein Amini

    06/21/2021, 10:47 AM
    Can anyone guide me on how DI should be handled in KMM projects? In the shared module, I’ve created my usecase that is dependent on a repository object (also repository is dependent on other objects). I use Koin in android and shared module and everything works well. But in iOS I don’t have any idea how to inject the repository into the usecase.
    t
    r
    +3
    • 6
    • 29
  • a

    akapanina

    06/21/2021, 11:33 AM
    Hey folks! Kotlin team would like to learn more about iOS developers experience with Kotlin Multiplatform. And we are looking for people to talk to 🙂 If you are a Kotlin Multiplatform developer with iOS background yourself, or if you have an iOS developer colleague who would not mind talking to me - please, put ➕ to this message and I’ll contact you. Thanks and have a fun Kotlin! :kotlin-flag:
    ➕ 5
    g
    • 2
    • 1
  • n

    n8ebel

    06/21/2021, 3:44 PM
    Hey 👋 I’m trying to build just the simple Hello World project generated by the KMM plugin in Android Studio, but I’m using the Cocoapods plugin for the first time and struggling to get the iOS project building. Within
    shared/build/bin
    i see that
    shared.framework
    seems to contain all the classes/methods I would expect But within
    shared/build/cocoapods
    the
    shared.framework/headers
    directory only contains
    placeholder.h
    XCode seems to recognize the shared framework alright (no warnings on the import) but it fails to resolve any of the classes within the framework Is there some task that needs running, or other automagical step, that I’m missing to link/package what’s in
    build/bin
    to the cocoapod output?
    k
    r
    • 3
    • 18
  • r

    Rak

    06/21/2021, 5:02 PM
    I’m building on top of the KMM template project. I need to save some data in Shared Preferences. How does my actual method access the Context object in the Platform class?
    t
    • 2
    • 3
  • s

    Slackbot

    06/21/2021, 7:54 PM
    This message was deleted.
    g
    • 2
    • 1
  • n

    napperley

    06/22/2021, 2:03 AM
    In a bit of a Multiplatform design quandary. I am maintaining a Kotlin Native library that currently supports two Linux targets (linuxX64 & linuxArm32Hfp). The maintained library uses a C library as a base (dependency), however there are some parts of the dependency which are only applicable to some Unix based targets (eg Linux). Initially I was looking at having the Unix bits shared in the common module, however that would mean it would need to be available for all platform modules which won't work if a new platform module is added that isn't Unix based. Kotlin 1.5.20 will have the new platform code sharing feature however that would only cover a single platform. Is there a way cover the code sharing for Unix based targets scenario?
    r
    m
    • 3
    • 3
  • t

    Tristan

    06/22/2021, 12:55 PM
    Hello, Is it possible to have a KMM project nested in another one? Like create a KMM library, and the project includes a test app build with KMM as well.
    c
    • 2
    • 7
  • b

    Bailey Pollard

    06/22/2021, 4:19 PM
    Hey folks, another question for you all - I have a class file in both `iosX64Main`/`iosArm64Main` directories that I need to access directly from a
    .swift
    file. When I had this class file inside
    iosMain
    I could successfully call the class without any issues. I recently had to move this file into `iosX64Main`/`iosArm64Main` to access some external library that was added, but I can no longer call this class from the
    .swift
    file. Any suggestions?
    h
    • 2
    • 6
  • p

    Pavlo Huk

    06/22/2021, 5:11 PM
    Hey 👋 . Does someone share viewmodel for mobile and web/desktop, what’s the best architecture to try and are there some examples to learn from? I already saw D-KMP, but want to check more solutions, maybe you already have some. Thanks!
    a
    m
    • 3
    • 4
  • m

    Mohit Khanna

    06/22/2021, 7:55 PM
    Hi all, Wondering if anyone has experimented around what the size impact is if using KMM instead of native platform for doing the same work? I tried, but not sure if I'm measuring it right on iOS.. To measure it, I created simple Hello World apps using XCode and AndroidStudio. The native iOS app (created by default in XCode) seems to be ~450 KB while the one created for iOS using KMM in AndroidStudio seems to be ~2.5 MB. This difference seems HUGE! And I feel I might be doing something wrong in measuring the sizes as I'm not from iOS background. Here's what I'm doing - For the app created in XCode, I created an Archive of it, and then zipped the archive (followed one of the SO posts). For the one created through KMM in AndroidStudio, I'm looking at the size of file called 'iosApp' in build->ios->Debug-iphonesimulator->iosApp. I did similar test for Android, where sizes are comparable. Can someone share if I'm measuring the iOS size wrongly? Or what your observations of size impacts of using KMM have been?
    👀 1
    e
    k
    +3
    • 6
    • 36
  • e

    edwinRNDR

    06/23/2021, 7:37 AM
    Does anyone have recommendations (pref existing ones) for gradle plugins that turn a directory of files (text files in my case) into a .kt file with string vals holding the contents of the files?
    b
    r
    • 3
    • 6
  • j

    Jad Doueik

    06/23/2021, 8:58 AM
    Heyy I am trying to make an API call using ktor using the native engines, on ios I am getting an TLS sessions are not supported on Native platform error can anyone help me find a solution please? I am using ktor 1.6.0
    r
    • 2
    • 12
  • r

    Rak

    06/23/2021, 11:48 AM
    Hi, I’m seeing an error when i run :
    mutation attempt of frozen kotlin.collections.HashMap@2be0d88
    I’ve tried the fix here : https://github.com/Kotlin/kotlinx.serialization/issues/1450 but it still fails
    j
    • 2
    • 3
  • c

    Colton Idle

    06/23/2021, 1:52 PM
    https://blog.jetbrains.com/kotlin/2021/06/kmm-for-appcode/ Looks pretty cool. I don't do iOS development so I don't know what certain features actually mean to me as a KMM dev... like
    To build the iOS part, AppCode generates a temporary Xcode project and invokes the Xcode build system, so you can be sure that our Gradle project model will work the same as a regular Xcode project does.
    Can anyone shed light on this? I'm using kmm now and doesn't it always generate an xcode project in the begining which is what allows us to open up the project in xcode?
    🔥 7
    i
    j
    +3
    • 6
    • 11
  • a

    alorma

    06/23/2021, 3:31 PM
    Hello... i'm very new to multiplatform, I've tried to copy PeopleInSpace (from @John O'Reilly) here: https://github.com/alorma/Irc-Compose, but i'm receiving some errors 🧵
    j
    s
    • 3
    • 23
  • y

    Yaniv Sosnovsky

    06/23/2021, 3:33 PM
    Hi guys. Does anyone know a DB (SQL\NO-SQL) library for multiplatform that supports iOS, Android & linux? I know that SQLDelight doesn’t support linux at the moment. It also looks like Realm (No-SQL) doesn’t support it either. Same goes for Kodein-DB which is also in Beta… Frustrating… Edit: I encountered this site which states that sqldelight supports linux as well, has anyone tried to integrate this on linux?
    k
    • 2
    • 2
  • k

    Kurt Renzo Acosta

    06/23/2021, 7:16 PM
    Hi. When I’m building my project using cocoapods, it takes a really long time on my first build. Specifically the
    podBuild<Library>Iphoneos
    and ``podBuild<Library>Iphonesimulator` tasks. They run up to 20 mins when I invalidate caches on my IDE… Does anyone have an idea on why this is happening? Thanks!
    e
    • 2
    • 2
  • l

    linz

    06/23/2021, 9:35 PM
    hey folks. has anyone else run into this error when trying to validate an iOS build with appstoreconnect? I wasn't having this issue before adding cocoapods to my kmm project.
    • 1
    • 1
  • t

    Toby

    06/23/2021, 11:28 PM
    So apparently, I can't anymore use
    var
    in an object.. What can I do about it? (language version 1.5.10 and only in within the multiplatform module)
    e
    k
    • 3
    • 4
  • b

    Bill Mårtensson

    06/24/2021, 11:00 AM
    How is the status om running KMM on iOS simulator on M1 Mac? I create new project using latest version. Can run on device but not on simulator.
    ld: warning: ignoring file /Users/xxxx/project/android/yyyy/shared/build/cocoapods/framework/shared.framework/shared, building for iOS Simulator-arm64 but attempting to link with file built for iOS Simulator-x86_64
    Undefined symbols for architecture arm64:  "_OBJC_CLASS_$_SharedGreeting", referenced from:    objc-class-ref in ContentView.o ld: symbol(s) not found for architecture arm64
    ✅ 2
    o
    b
    s
    • 4
    • 23
  • s

    Samuel Michael

    06/24/2021, 1:07 PM
    Getting some errors with KMM plugin in AppCode, what is the ideal version to try for those who got it working? Also I seem to be unable to open an issue for this on YouTrack...
    l
    • 2
    • 27
  • e

    eygraber

    06/24/2021, 9:30 PM
    If I have a library that is written entirely in common code, and I want to consume it from Android and JVM, do I need both targets, or
    jvm
    would be enough?
    r
    j
    j
    • 4
    • 5
  • r

    Robert Munro

    06/25/2021, 9:13 AM
    What is the best URL/Uri class (or library) to use for KMP common?
    e
    t
    +3
    • 6
    • 6
  • c

    Charles Prado

    06/25/2021, 9:43 AM
    There's some way to export comments from shared module to iOS module (objc headers) ? I mean:
    / * 
    * It does something
    * /
    fun doSomething() { ... }
    In iOS when I type doSomething it's possible to make that comment visible there?
    h
    • 2
    • 3
  • i

    iamthevoid

    06/25/2021, 10:47 AM
    Did anybody check AppCode+KMM plugin? Quick look shows me that my scripts and sources from buildSrc folder not recognized by appcode+kmm-plugin. explanation: i created empty kmm project with kmm-plugin from appcode and starts to modify my current work project gradle scripts (in androidApp module) the same way as in new project. When i finally changed gradle script structure in my work project build starts fail with errors (
    unresolved reference
    from buildSrc sources). I miss something or AppCode doesn’t recognize buildSrc sources?
    a
    v
    s
    • 4
    • 15
  • g

    Guilherme Delgado

    06/25/2021, 11:55 AM
    Hello! In result from my KMM experiments with @Charles Prado, this is my (our) last post. Hope you find it useful 🙂 https://guidelgado.medium.com/kotlin-multiplatform-mobile-solving-network-responses-with-teamwork-c342762d9401
    :kotlin-intensifies: 11
    c
    • 2
    • 1
  • j

    Josep Rovira

    06/25/2021, 1:55 PM
    I am having trouble with the kotlin multiplatform project templates, would you guys recommend the github one or android studio plugin?
    g
    • 2
    • 2
  • p

    ptsiogas

    06/25/2021, 2:21 PM
    Hello, I am trying to get a coverage report for a KMM shared module in Android Studio. The option “Run “All Tests” with Coverage” seems to ignore all tests in the “commonTest” folder. What is the suggested way to measure code coverage of a KMM shared module;
    • 1
    • 1
Powered by Linen
Title
p

ptsiogas

06/25/2021, 2:21 PM
Hello, I am trying to get a coverage report for a KMM shared module in Android Studio. The option “Run “All Tests” with Coverage” seems to ignore all tests in the “commonTest” folder. What is the suggested way to measure code coverage of a KMM shared module;
Anyone?
View count: 5