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

    Marc Reichelt

    10/27/2021, 10:16 AM
    Hi there! The last time I checked, we could not create a single Gradle source set for multiple targets, like iosX64 and iosArm64. Is that possible now? So to speak, having only one
    actual
    implementation for all iOS variants (which can be 3 if we also add the arm64-simulator).
    e
    • 2
    • 3
  • h

    Hadji Musaev

    10/27/2021, 2:39 PM
    Hey guys! I’m having some difficulties with setting up tests for my KMM project which is supposed to produce an android library among other artifacts. I get this error:
    Execution failed for task ‘:generateDebugBuildConfig’.
    > Error while evaluating property ‘buildConfigPackageName’ of task ‘:generateDebugBuildConfig’
    > Failed to calculate the value of task ‘:generateDebugBuildConfig’ property ‘buildConfigPackageName’.
    > Failed to query the value of property ‘packageName’.
    > Manifest file does not exist: /…/src/main/AndroidManifest.xml
    And indeed the project structure is different and my android modules are
    androidMain
    and
    androidTest
    , not just
    main
    and
    test
    . Has anyone had to solve this problem?
    d
    • 2
    • 3
  • s

    Sylvain Patenaude

    10/27/2021, 8:05 PM
    Someone know why
    freeze()
    isn't part of the stdlib-common? Would be useful in multiplatform common code.
    m
    • 2
    • 9
  • a

    Ahmet Özcan

    10/27/2021, 8:44 PM
    Hello guys, Is there any one who tried to use new memory model which is using Kotlin compiler 1.6.0-M1 with Compose ?
    k
    • 2
    • 2
  • n

    napperley

    10/27/2021, 10:44 PM
    Are there any plans for the Multiplatform Gradle plugin to have the option to set static library paths? Getting really tired of having to hard code static library paths in def files (eg: https://gitlab.com/napperley/lvgl-hello/-/blob/master/src/nativeInterop/cinterop/lvgl.def ).
    👍 1
    👀 4
    a
    • 2
    • 1
  • g

    Goth

    10/28/2021, 12:05 AM
    anyone had "`Debug information is inconsistent`" bug with Intellij while in debug mode?
    a
    • 2
    • 1
  • b

    Brian Donovan

    10/28/2021, 12:42 AM
    "io.ktor:ktor-server-cio"
    can I use this with commonMain?
    k
    • 2
    • 1
  • m

    Marc Reichelt

    10/28/2021, 9:29 AM
    Hi there! Does anyone know if we can create a swiftpackage with standard Kotlin tooling (so not using the https://github.com/ge-org/multiplatform-swiftpackage gradle plugin?) We would love to use that one, but it does not support creating 3 architectures at once for now, and it creates & uses a new
    createXCFramework
    task, which is different from the
    assembleMyModuleReleaseXCFramework
    task that the official Kotlin tooling provides, but does not support the arm64-simulator slice at the moment. I’m kind of tempted to write some custom Gradle tooling already, because creating the swiftpackage is basically: creating the xcframework (which
    assembleMyModuleReleaseXCFramework
    already does), creating a simple
    Package.swift
    file, and zipping that. Thanks a lot for helping! 👏
    g
    e
    k
    • 4
    • 4
  • c

    Charles Jo

    10/28/2021, 12:03 PM
    Hi there! Can we build library by using KMM? I mean not application. I have built application with KMM. But I want to build independent library to support Android and iOS with KMM. Is it possible?
    b
    y
    o
    • 4
    • 11
  • y

    Yehonatan Levi

    10/28/2021, 12:15 PM
    when i just create kmm project it doesn't work out of the box, can anyone help?
    g
    • 2
    • 2
  • s

    Sylvain Patenaude

    10/28/2021, 4:00 PM
    So I added a test under
    /src/iosTest
    because it involves native stuff like workers. I also have some multiplatform code spread like this: • In
    src/commonMain
    , code with some
    expected
    declarations. • In
    src/jvmMain
    , code with some
    actual
    declarations. • In
    src/iosMain
    , code with some
    actual
    declarations. Now when I run this on a simulator (vmImage
    masOS-10.14
    on DevOps), I get the following error when the process tries to run task `compileKotlinIosSim`:
    Expected function 'myFunction' has no actual declaration in module <MyModule> for Native
    Now technically I have 2 targets,
    iosX64("iosSim")
    and
    iosArm64("ios")
    , so I think this is causing my issue, but I don't know how to fix it. Thanks in advance for the help!
    m
    • 2
    • 2
  • g

    Graeme Laws

    10/28/2021, 9:40 PM
    Hi guys. Hopefully this is the best place to ask. I'm currently evaluating building our app in Kotlin Multiplatform. There is a separate iOS project being developed, but the idea is to keep the door open to implement the iOS version in the KMM project later down the line. I've been researching app architectures, and there doesn't seem to be a main consensus on the best one to use (even a link to a page on the kotlin homepage discussing this is no longer available). One of the requirements is we'll be using Jetpack Compose and SwiftUI, and it seems only the MVI pattern allows us to be truly multiplatform without separate presentation logic and testing. The issue is that most of these articles i've been reading are a few years old now, and I wanted to know what the latest recommendations are? I found the todoapp example project which seems to satisfy our requirements. Would this be the recommended way to go? https://github.com/JetBrains/compose-jb/tree/master/examples/todoapp (edited)
    👍 1
    m
    a
    l
    • 4
    • 57
  • j

    jimmyt

    10/28/2021, 11:56 PM
    Hey, I'm trying to add a CocoaPod dependency to my KMM project and the build process keeps failing due to compiler errors during the cinterop task. But Gradle isn't telling me what the compiler error is, it is only telling me that a fatal error occurred. Even when I run with --info or --debug options, I don't get any more details about the compiler error. How can I get information from cinterop so that I can see what the problem is?
    k
    • 2
    • 7
  • k

    kavi

    10/29/2021, 2:30 PM
    anybody come across any issues publishing to maven recently? we have a multi-module setup where our final Android lib – an SDK we’re building – has an implementation dependency on our KMM lib but have just run into this error whenever we try and build an android app that has a dependency on our SDK…
    Could not resolve all files for configuration ':samples:unflow-compose:debugRuntimeClasspath'.
    > Could not resolve com.unflow:unflow:1.0.1.
      Required by:
          project :samples:unflow-compose > com.unflow:unflow-ui:1.0.1
      > Could not determine whether value 7.2.0-alpha02 is compatible with value 7.1.0-beta02 using AgpVersionCompatibilityRule.
        > Using multiple versions of the Android Gradle plugin(7.2.0-alpha02, 7.1.0-beta02) in the same build is not allowed.
    🙏🏾 1
    👀 1
    k
    • 2
    • 3
  • m

    Marcello Galhardo

    10/29/2021, 10:56 PM
    Does anyone have an example of KMM project (Android and iOS) designed as a Multi Module project? I want to avoid a monolithic "shared" module and I feel everything I find on the internet is very tiny examples... 🤔
    👀 5
    m
    a
    • 3
    • 2
  • x

    xxfast

    10/30/2021, 3:05 AM
    Hi, im trying to migrate from
    packForXCode
    to
    embedAndSignAppleFrameworkForXcode
    according to this. However, i dont see this task included by default. I’m on kotlin
    1.5.31
    . Am I missing something? It says
    new 
    embedAndSignAppleFrameworkForXcode
     in the generated project configuration.
    what if have an existing project that was generated before 1.5.20? 🤔 is there a way to bring this task to my existing project?
    • 1
    • 1
  • j

    jimmyt

    10/30/2021, 3:13 AM
    Has anybody discovered a reliable solution to the "module not found" error that sometimes appears when using CocoaPods with KMM? I've been encountering it seemingly at random for no reason, and I have yet to find a consistent way to fix it.
    m
    • 2
    • 2
  • b

    Brian Donovan

    10/30/2021, 12:12 PM
    Anyone has a sample project implementing login logic using KMM, Ktor with JWT? I’m super stuck on dependencies and every time I sync something crashes.
    c
    • 2
    • 3
  • p

    Piotr Krzemiński

    10/30/2021, 3:36 PM
    Is anyone interested in compiling Kotlin into Python? If so, please share your use case in this thread. Together with @SerVB we're working on compiling Kotlin to Python (#python). The more data about real use cases we have, the better we can do in terms of deciding on MVP's scope!
    :kotlin-intensifies: 2
    h
    i
    • 3
    • 8
  • m

    Mustafa Ozhan

    10/31/2021, 12:39 PM
    Hello 👋 Maybe not related with Multiplatform but with the new android gradle plugin 
    7.2.0-alpha03
     I am unable to compiled my project, I have the scopemob(kmp library) project in the mentioned path and it works with 
    7.2.0-alpha02
     without problem
    Cannot find module with id: GradleProjectPath(buildRoot=/Users/mustafa.ozhan/Projects/Personal/CurrencyConverterCalculator/CCC, path=:scopemob, sourceSet=MAIN)
    Do you have any idea how to solve this ?
    l
    • 2
    • 5
  • t

    TheOnlyTails

    10/31/2021, 6:11 PM
    commenting out the
    complete-kotlin
    plugin fixes this.
    🧵 1
    b
    • 2
    • 1
  • b

    Brian Donovan

    11/01/2021, 6:43 PM
    I’m not sure why this is not importing
    r
    j
    • 3
    • 7
  • b

    BearDev

    11/02/2021, 10:52 AM
    Hi, recently my intellij idea stopped seeing my jvmMain correctly. It doesn't recognize any main functions and Run/Debug configuration does not see any classes. It was working before, and I am not sure what changed to break it. Any help would be appreciated.
    g
    • 2
    • 6
  • b

    Brian Donovan

    11/02/2021, 6:27 PM
    Hello, I’m setting up my LoginViewModel inside of commonMain and trying to extend CoroutineViewModel which is inside of my appMain. Am I not supposed to do this?
    g
    • 2
    • 10
  • u

    Umberto Pompei

    11/02/2021, 7:00 PM
    Hello! I am quite confident nowday with kmm on mobile but now I’d like to go further and include a backend module. What would be the best approach for sharing some code between jvm , android and ios like for example some base models and some other code just between android and ios like networking and mobile buisiness logic? Is that something achievable? I tried to build 2 different multiplatform modules in the project binding one to jvm,android and ios and the other one just for android and ios but it seems it is not possible to have 2 separate multiplatform modules under same project, only first one seems to be recognized by gradle. So I tried to have a single multiplatform module for jvm, android and ios and then nest into it another module just for ios and android but I am fighting against lots of issues. Can anyone point me to right direction if any? thanks a lot
    g
    m
    • 3
    • 3
  • s

    Steffen Funke

    11/03/2021, 8:07 AM
    Hi, probably off topic: Does anyone know, or is there even, a dedicated Slack community like this for iOS / SwiftUI related stuff?
    j
    m
    • 3
    • 5
  • c

    Clament John

    11/03/2021, 8:52 AM
    Difficulty importing
    kragle
    library in
    multiplatform
    example app - todo I created a Minimal reproducible example using the
    multiplatform
    todo app. When imported from the common module it fails, but when imported from the desktop module it works. I'm confused. I've raised an question on
    krangl
    repo - Issue#132
    t
    j
    • 3
    • 13
  • s

    Stefan Oltmann

    11/03/2021, 9:55 AM
    I want to use SwiftUI
    ForEach
    on an
    KotlinArray
    , but I get
    Generic struct 'ForEach' requires that 'KotlinArray<MyType>' conform to 'RandomAccessCollection'
    . Is there any compatiblity layer build in for that?
    l
    s
    a
    • 4
    • 5
  • s

    Stefan Oltmann

    11/03/2021, 11:06 AM
    I got a switch in Swift on a Kotlin enum defined in
    commonMain
    and XCode complains that it's not exhaustive - but I covered every case. Is this a known bug in Kotlin/Native ?
    :yes-black: 2
    s
    l
    +4
    • 7
    • 16
  • s

    simon.vergauwen

    11/03/2021, 11:54 AM
    Has anyone tried using Kover? https://github.com/Kotlin/kotlinx-kover Simply adding the plugin into Gradle breaks my project.
    s
    j
    • 3
    • 15
Powered by Linen
Title
s

simon.vergauwen

11/03/2021, 11:54 AM
Has anyone tried using Kover? https://github.com/Kotlin/kotlinx-kover Simply adding the plugin into Gradle breaks my project.
s

Stefan Oltmann

11/03/2021, 12:01 PM
Because you have no unit test coverage? 😆
SCNR 😛
😂 1
s

simon.vergauwen

11/03/2021, 12:10 PM
No, it fails to resolve dependencies. My project can resolve Arrow fine, and when I add Kover it fails to resolve Arrow saying it cannot find it in the Jebtrains repo 🤒
Like it’s somehow removing
mavenCentral
from my
repositories { }
or something
s

Stefan Oltmann

11/03/2021, 12:29 PM
Thanks for testing that out, because Kover is also on my list of things to try out. 🙂
j

Javier

11/03/2021, 12:58 PM
it doesnt work
there is an issue about that problem
s

simon.vergauwen

11/03/2021, 1:28 PM
I couldn’t find the issue @Javier.
Do you mind linking it?
j

Javier

11/03/2021, 1:39 PM
https://github.com/Kotlin/kotlinx-kover/issues/34
s

simon.vergauwen

11/03/2021, 1:48 PM
Thank you
😄 1
s

Stefan Oltmann

11/03/2021, 3:51 PM
The presentation is in 24h ^^ Hope they get it fixed for prime time 😄
🤞 1
Works for me with 0.4.1 🙂
👍 1
👍🏼 1
j

Javier

11/05/2021, 10:35 AM
I am having the same issue with that version
s

simon.vergauwen

11/05/2021, 10:42 AM
Same
View count: 14