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

    vishal G

    03/07/2022, 6:56 AM
    Can someone share an example project used with russolf multiplatform settings in a KMM project
    a
    m
    +3
    • 6
    • 10
  • a

    Aditya Kurkure

    03/07/2022, 3:05 PM
    Can I pass a function
    (UIBackgroundFetchResult) -> void
    from swift to Kotlin? Currently the method I have written in kotlin expects a
    (UIKUIBackgroundFetchResult) -> void
    when called from swift.
    s
    a
    • 3
    • 6
  • v

    Vivek Modi

    03/07/2022, 10:02 PM
    Hey everyone what is the d/w
    iosX64(),iosArm64() and iosSimulatorArm64()
    in kmm gradle file. Can someone explain ?
    h
    l
    • 3
    • 4
  • m

    mittapalli hareesh

    03/08/2022, 6:04 AM
    Hi, Can anyone help me … In KMM is there any sample gitHub project / code, which using coroutines mainly in “iosMain” i wanted to know how we can use coroutines.
    x
    m
    e
    • 4
    • 3
  • b

    brabo-hi

    03/08/2022, 6:54 AM
    Hi, when is kmm mobile expected to go beta?
    m
    • 2
    • 1
  • k

    Kamil Matuła

    03/08/2022, 8:22 AM
    hi guys, I have problem with KMM on iOS - I want to migrate from
    packForXcode
    to
    embedAndSignAppleFrameworkForXcode
    in xcode build phase. (regarding to this article: https://blog.jetbrains.com/kotlin/2021/07/multiplatform-gradle-plugin-improved-for-connecting-kmm-modules/) shared (KMM) module compiles correctly, but code autocompletion stops to work… anyone know how to resolve this problem?
    s
    • 2
    • 3
  • a

    Andrew O Hart

    03/08/2022, 12:07 PM
    Hey all. Hoping somebody with experience can help. Trying to work on uploading to jenkins and nexus pipelines. In our old project we had custom createPOM and buildXCFramework tasks that we used in our JenkinsFile, however since the upgrade to gradle 7 this has to change. Does anybody know how we can do something similar with gradle 7? Build the pom and ios framework etc
    b
    • 2
    • 39
  • b

    brabo-hi

    03/08/2022, 7:11 PM
    Hi all, in a KMM
    androidMain
    shared project, how can we get access to
    BuildConfig.APPLICATION_ID
    BuildConfig.VERSION_CODE
    BuildConfig.VERSION_NAME
    r
    x
    w
    • 4
    • 4
  • v

    Vivek Modi

    03/08/2022, 11:22 PM
    Hey guys, I am trying to use Kmm with cocoapods dependence manager. I want to share podspec file with my ios team. So I create a sample project with cocoapod. I want to share podspec through repository.But I am not able to use framework or library inside my Ios Project through Podfile. I am adding my detail

    screen record▾

    video which demonstrates how I am setup every thing one by one. Can someone tell me What I am doing wrong? My KmmCocoapods and KmmPod github repository. Thanks
    • 1
    • 2
  • c

    Conrad Kramer

    03/09/2022, 1:29 AM
    Is there a cinterop
    .def
    file reference anywhere?
    • 1
    • 1
  • m

    mittapalli hareesh

    03/09/2022, 8:16 AM
    Hi All, Can anyone help me, W.r.to Unit-Tests in KMM How to get Android context in Kotlin Multiplatform Android test?
    t
    • 2
    • 2
  • j

    Jonas Frid

    03/09/2022, 9:26 AM
    I am using kotlinx.datetime. How do I calculate the difference between two LocalDateTime in years and months?
    p
    • 2
    • 1
  • a

    Andrew O Hart

    03/09/2022, 10:16 AM
    Has anybody managed to get Jacoco working on gradle 7? I keep getting failures when I run the jacocoTestReport task but it doesn't really tell me what
    m
    v
    • 3
    • 4
  • n

    nikhil kumar

    03/09/2022, 11:21 AM
    Hey Guys,Is there an library similar to java.io that can be used in KMM?
    y
    l
    • 3
    • 3
  • o

    Orhan Tozan

    03/09/2022, 2:25 PM
    Trying to write some Multiplatform tests, but Android Studio is giving me a "Kotlin not configured" error in the testing file. Anyone have a clue?
    j
    m
    • 3
    • 4
  • m

    Matti MK

    03/09/2022, 2:59 PM
    Trying to get existing KMM project to build on Intel Mac, but stuck on the following. This error appears both when attempting to run Gradle Sync from Android Studio and when running
    ./gradlew :shared:podInstall
    on command line (both terminal and Android Studio)
    Execution failed for task ':shared:podInstall'.
    > 'pod install' command failed with code 1.
      Error message:
      
             Please, check that podfile contains following lines in header:
             source '<https://cdn.cocoapods.org>'
      
              Please, check that each target depended on shared contains following dependencies:
    Running
    pod install
    from terminal in iOS project folder works well.
    locale
    on both Android Studio & terminal output
    LANG="en_US.UTF-8"
    .
    cocoapods (1.11.2)
    and
    cocoapods-generate (2.2.2)
    versions seem to be fine. Android Studio version is
    2020.3.1
    and Xcode
    13.2.1
    . Any tips on fixing the issue?
    k
    • 2
    • 4
  • d

    darkmoon_uk

    03/10/2022, 2:58 AM
    Any experiences using KMM to share code between an Android Native project and a React Native project? I imagine this can be done by transpiling module(s) to NPM-module via Kotlin/JS, but not sure if any required bindings present a barrier. (Disclaimer: Yes I would rather use KMM for the whole project, but that's just not a situation I can change, however this code-sharing route may be viable).
    x
    a
    • 3
    • 5
  • n

    nikhil kumar

    03/10/2022, 9:32 AM
    Hey Guys, Has anyone used java.io.File in Kmm or something similar ?
    m
    • 2
    • 1
  • v

    vishal G

    03/10/2022, 10:38 AM
    How to insert kotlin datetime into sqldelight can someone share any example
    s
    j
    • 3
    • 4
  • a

    Andrew O Hart

    03/10/2022, 4:37 PM
    Hey all wondering if anybody has had issues with pulling the DB off ios? I have worked on a branch integrating sqldelight, and i can store and create a db fine, and can pull it from Window/Devices & Simulators and also view it using DB Browser However somebody is testing my ticket and when they pull the branch and do the exact same steps as me, and try view the DB it says it cant be found Not sure if there is some issue with how it is getting build when pulled from bitbucket vs how i have it locally Tried get him to delete the Pods folder and run Pod install again which is what i did, but no luck
    • 1
    • 1
  • n

    nikhil kumar

    03/11/2022, 11:32 AM
    Hey guys, Does okio have something similar to ByteArrayOutputStream?
    j
    y
    • 3
    • 2
  • m

    Martin Rajniak

    03/11/2022, 3:42 PM
    Do you folks use KMP code from native (iOS) background threads? I have an existing iOS project and would like to replace single platform solution in it with KMP library. Currently iOS project is calling the solution from the background thread. Naively I thought I will just replace one callback method with another (generated from
    suspend
    function). But this is not possible if I understand correctly:
    Calling Kotlin suspend functions from Swift/Objective-C is currently supported only on main thread
    I am using Kotlin 1.6.10, Coroutines 1.6.0 (without
    native-mt
    ) and new experimental memory model. Is the current practice to leave threading to multi-platform code or am I missing something?
    r
    m
    +2
    • 5
    • 8
  • m

    Marko Novakovic

    03/14/2022, 2:19 PM
    anyone have example of using kotlin-inject in KMM (Android and iOS targets) project? using KSP or KAPT, doesn’t matter
    p
    • 2
    • 8
  • i

    Igor Milakovic

    03/14/2022, 6:25 PM
    How do you guys run your tests in the shared module? I was following this article but it doesn't quite work as expected: https://touchlab.co/understanding-and-configuring-your-kmm-test-suite/ The suggested
    ./gradlew :shared:allTests
    does not run Android tests. That's not that big of a deal, since
    ./gradlew :shared:check
    does run both. But the problem is that running any of those repeatedly doesn't fail any longer when iOS tests fail. Luckily, can be fixed by adding
    :shared:clean
    before
    :shared:check
    but then it doesn't proceed with Android tests after iOS fails... And so on, haha. So yeah, how do you people run your tests, what is the magic command/configuration? 🙂 Thanks!
    m
    j
    m
    • 4
    • 7
  • j

    Jose Garcia

    03/15/2022, 10:06 AM
    Is it normal to see the Android source set as the ios targets sourcesets when using the
    Android
    view on the file explorer panel?
    l
    j
    j
    • 4
    • 16
  • w

    wasyl

    03/15/2022, 3:42 PM
    hey folks, I can’t figure out how to set compatibility in
    jvm
    (not android) target to not allow APIs from java 8, is it possible? There’s
    jvmTarget
    configuration but it relates only to bytecode as far as I see. Context: the jvm artifact is consumed by an Android app and we’d like to avoid desugaring, so we want to forbid using Java 8 APIs (like
    java.time
    ) in the
    jvmMain
    source set.
    e
    m
    • 3
    • 7
  • m

    Martin Rajniak

    03/15/2022, 6:29 PM
    Hello, do you know how can I get more info when signing is failing in
    embedAndSignAppleFrameworkForXcode
    at least that is what I think is happening here)
    > Task :embedAndSignAppleFrameworkForXcode FAILED
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    A problem was found with the configuration of task ':embedAndSignAppleFrameworkForXcode' (type 'Copy').
      - Type 'org.gradle.api.tasks.Copy' property 'sign' doesn't have a configured value.
        
        Reason: This property isn't marked as optional and no value has been configured.
        
        Possible solutions:
          1. Assign a value to 'sign'.
          2. Mark property 'sign' as optional.
        
        Please refer to <https://docs.gradle.org/7.2/userguide/validation_problems.html#value_not_set> for more details about this problem.
    p
    • 2
    • 11
  • p

    ptsiogas

    03/16/2022, 9:23 AM
    Hi there, I have a tricky question: Can I add a dependency like the example below and use it’s code in the iOS App?
    sourceSets {
            val commonMain by getting {
                dependencies {
                    api ("com.myLib:feature:$myFeatureVersion")
                }
            }
            val androidMain by getting {
                dependencies {
                    api ("com.myLib:feature-android:$myFeatureVersion")
                }
            }
            val iOSMain by getting {
                dependencies {
                    api ("com.myLib:feature-ios:$myFeatureVersion")
                }
            }
    }
    • 1
    • 1
  • n

    nikhil kumar

    03/16/2022, 9:34 AM
    Hello, can moshi be used with kmm?
    s
    m
    • 3
    • 3
  • t

    Thomas Kranzer

    03/16/2022, 11:42 AM
    Is it recommended to use the new Memory Model for new KMM Projects? If yes, what are the compatible (and recommended) versions for Coroutines, Ktor, SqlDelight and Koin?
    m
    • 2
    • 1
Powered by Linen
Title
t

Thomas Kranzer

03/16/2022, 11:42 AM
Is it recommended to use the new Memory Model for new KMM Projects? If yes, what are the compatible (and recommended) versions for Coroutines, Ktor, SqlDelight and Koin?
m

Martin Rajniak

03/16/2022, 1:51 PM
Hi, it is still experimental, so I doubt you will get an official recommendation 🙂 But I would definitely go for it. Especially since it is a new project and old model required a lot of hacks to work. Touchlab defaulting to new memory model might also help you decide 😉 https://touchlab.co/kmm-memory-model-when-to-switch/ There is a migration guide where you can find details about versions. https://github.com/JetBrains/kotlin/blob/master/kotlin-native/NEW_MM.md#enable-the-new-mm But you can still use it with older versions of libraries. https://github.com/JetBrains/kotlin/blob/master/kotlin-native/NEW_MM.md#using-previous-versions-of-the-libraries
View count: 23