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

    Milen Dimitrov

    07/20/2021, 8:52 AM
    Hi everyone, is there a multiplatform MVVM semple project? I want to make a pet app to explore KMM capabilities, and if there is such a project, I do not want to reinvent the wheel 😄
    s
    m
    a
    • 4
    • 4
  • p

    Pitel

    07/20/2021, 11:06 AM
    Any idea why
    @AfterTest
    is ran before
    @Test
    returning JS promise finishes in Node.js test?
    👀 2
    • 1
    • 4
  • j

    jdiaz

    07/21/2021, 11:24 AM
    Has anyone had trouble with indexing common dependencies? I add a dependency to the common and IntelliJ does't show it though I can write the import and use the class and build with
    gradlew build
    just fine
    l
    • 2
    • 4
  • j

    Jason5lee

    07/21/2021, 1:46 PM
    I want to write a common library that only has common sourceset and it can be depended from the common main of another mpp project and the codes run on any target. How should I do it?
    b
    • 2
    • 6
  • m

    mike.holler

    07/21/2021, 5:21 PM
    Anyone have a good example for a multiplatform library project that publishes to NPM? We have a use-case where we want to make a library in Kotlin and use it in a pure javascript repository. I tried this about a year ago and there were some rough edges, particularly around transitive library dependencies, that existed. I've read from bugfixes that it's better now, and I'd really like to see an example. Anyone have an idea?
    b
    a
    • 3
    • 100
  • c

    coolcat

    07/21/2021, 8:47 PM
    Has anyone had any success with the
    native.cocoapods
    plugin recently? I am trying to write a KMM library whose iOS code depends on a cocoapod, which I import using
    cocoapods {
      pod("AFNetworking")
    }
    However
    cinterop
    gives me
    fatal error: module 'AFNetworking' not found
    as in this issue. But I don’t think it’s the same problem. Anyone had similar?
    v
    • 2
    • 5
  • s

    Stefan Oltmann

    07/22/2021, 7:21 AM
    What logging solution do you use in your iOS/Android projects? I see that the examples use Napier, but there is no support for macOS and judging from the old opened issues the project seems currently unmaintained. Kermit looks like a good option, but is only a pre-release. So what do you recommend?
    ✅ 1
    m
    k
    +2
    • 5
    • 91
  • c

    Carmelo

    07/23/2021, 1:43 PM
    Hi guys! I have a question (help request) for you all. Creating a new project and using Kotlin version
    1.5.30-M1
    with
    iosSimulatorArm64
    target is throwing me this error:
    Task 'embedAndSignAppleFrameworkForXcode' not found in project ':shared'.
    This is a new blank project so I was wondering what is wrong there. Any clue?
    r
    t
    • 3
    • 3
  • d

    deviant

    07/23/2021, 3:55 PM
    hey guys, is it normal for kmm project? each time i change 1 line of code and try to rebuild - it's starting the cold build process with redownloading all dependencies etc. sometimes it takes like 40 mins. is it kmm plugin bug or android studio? can't find matching issue in the bug tracker
    l
    l
    +3
    • 6
    • 21
  • a

    Andy Victors

    07/23/2021, 5:10 PM
    hey all, need help to understand this particular error message running KMP library on iOS. I am generally aware about memory models (see comments on screenshot) and it normally works. But in some cases, I could not really understand exactly when, I get crash because of this message. So do I get it right: it complains about accessing lambda/closure. I assume the complain comes from inside the async {} block (debug picture is ambiguous), means we are in main thread. The closure was created in the kotlin code before calling this method. Does it mean that closure has been created on Non-Main thread?
    i
    a
    t
    • 4
    • 8
  • k

    kevindmoore

    07/24/2021, 6:47 PM
    I have a shared library and am importing another “shared” module but my code doesn’t see those files (even though the import isn’t in red). Any ideas or articles on KMM gradle? Gradle is the hardest part of KMM for me
    m
    • 2
    • 3
  • s

    Sergei Popyvanov

    07/25/2021, 4:00 AM
    Hello, I’m new in KMM (kotlin
    version "1.5.10"
    ). I have an exception in iOS target:  Function doesn’t have or inherit @Throws annotation and thus exception isn’t propagated from Kotlin to Objective-C/Swift as NSError. It is considered unexpected and unhandled instead. Program will be terminated. Uncaught Kotlin exception: kotlin.UninitializedPropertyAccessException: lateinit property innerFactory has not been initialized ______________ Am I right that I should add @Throws annotations to all my methods in kotlin shared class? If yes, what exception class should I pass inside @Throws annotation. Thank you
    o
    • 2
    • 2
  • s

    spierce7

    07/25/2021, 5:41 AM
    In 1.5.30 one of the new features is Sharing custom cinterop libraries across platforms in multiplatform applications. Can someone explain what this is? It sounds very interesting and like something I’d potentially use, but it’s not really being specific. i.e. can I share cinterop libraries with a Java application?
    n
    d
    r
    • 4
    • 4
  • s

    Slackbot

    07/25/2021, 6:18 AM
    This message was deleted.
    n
    v
    • 3
    • 3
  • r

    rkeazor

    07/25/2021, 3:03 PM
    Does KMM only work in Android Studio or can it work in Intelij Idea as well?
    k
    a
    m
    • 4
    • 18
  • z

    Zhiqiang Bian

    07/25/2021, 3:25 PM
    Does anyone know any open source project that iOS can run on Mac M1? I have tried the kmm starter project of Android Studio, but it does not work for me.
    h
    s
    • 3
    • 3
  • m

    Matheus Finatti

    07/26/2021, 8:42 AM
    Has anyone been able to use the new shared lib integration method in iOS apps with multiple projects? My app is made of a few projects and all of them depend on the shared lib, currently I have a target for a shared framework where I call
    copyFramework
    in its build phases, this target is then included in all projects. I have tried adding it by changing
    copyFramework
    to the new
    embedAndSignFrameworkForXCode
    which didn’t work (project won’t compile because it can’t find the shared lib
    No such module 'shared'
    . Also tried removing this target entirely and recreating the steps in the blog post in every project, but it also didn’t work.
    i
    r
    • 3
    • 22
  • m

    marzelwidmer

    07/26/2021, 8:00 PM
    Ho I can setup a
    kmm
    project with
    JUnit5
    ? in special in the
    shared
    folder… I create a
    kmm
    from the wizard.
    c
    • 2
    • 5
  • v

    Vadim

    07/26/2021, 11:01 PM
    Hello! Learning about cinterop-related types and still can't get them right. In the code below, how should I define
    error
    variable on the Kotlin side to call this C function?
    int analyze(char **error);
    h
    • 2
    • 2
  • s

    spierce7

    07/27/2021, 2:51 AM
    Is there a multiplatform file api? I remember hearing okio or something was working on this, but I can’t find any reference to it anymore.
    g
    l
    • 3
    • 2
  • d

    deviant

    07/27/2021, 10:00 AM
    guys, is there a way to skip ios gradle tasks when building android. e.g.
    podspec
    ,
    podInstall
    etc?
    h
    • 2
    • 3
  • n

    nikunjsakhrelia

    07/27/2021, 10:51 AM
    I am trying to create a new KMM project using AS with kotlin KMM plugin installed as per website documentation its say to • "Select Xcode build phases (packForXcode task) in the list of iOS framework distribution options. but I dont see such option on my AS wizard I have 2 options Regular Framework or Cocopods Dependency manager
    m
    r
    a
    • 4
    • 4
  • c

    coolcat

    07/27/2021, 2:31 PM
    If I have 2 KMM libraries in a Gradle subproject, is it possible for library A to reference library B by using
    dependencies {
        implementation(project(":libB"))
    }
    When I do this my
    compileKotlinIos
    task fails with
    Unresolved reference
    for the classes in libB. Is there any special syntax for adding the common, android and ios flavours of the shared project?
    m
    • 2
    • 3
  • m

    Michal Klimczak

    07/27/2021, 3:13 PM
    I have some formatting defined in common code between ios and android target and just noticed that they treat special chars differently which messes my impl. I can't even properly paste it into slack, so I'll use screenshots to make it clearer, but take
    twenti̩
    as example. This
    i̩
    with a little dash at the bottom is treated by kotlin as two separate chars, but swift treats it as one. So when I defined formatting which spans across the whole word in shared code with
    text.length
    , it calculates it as 7 chars. When I use it in Swift, which thinks of it as 6 chars (via
    *let* characters = Array(text)
    ), I get
    Fatal error: Index out of range
    . Any ideas how to work with these?
    r
    • 2
    • 4
  • b

    Brian G

    07/27/2021, 4:03 PM
    I'm trying out the EAP Appcode and building a multiplatform Android/iOS app with gradle... Is there any way to have multiple "variants" of the iOS app like is possible with Android app "variants"? If not, is this a planned feature?
    • 1
    • 1
  • i

    iamthevoid

    07/28/2021, 6:37 AM
    Am i understand correct that
    value
    classes can not be used in shared code (because of
    @JvmInline
    )?
    t
    • 2
    • 1
  • b

    brandonmcansh

    07/28/2021, 2:42 PM
    Hey guys has anyone run into an XCFramework built not able to run on an actual iOS device when generating swift package
    k
    • 2
    • 11
  • c

    coolcat

    07/29/2021, 4:44 PM
    If I have a KMM umbrella framework, can I include another KMM subproject, which imports a cocoapod using the native.cocoapods plugin? When I try this I get a build error in Xcode:
    fatal error: module '<Cocoapod>' not found
    But if I include the subproject directly (instead of via the umbrella framework) it works OK. Is it possible to do this using an umbrella framework?
    v
    • 2
    • 1
  • j

    Javier

    07/29/2021, 5:26 PM
    Is there any plan to include the android gradle plugin inside kotlin multiplatform plugin?
    b
    • 2
    • 3
  • f

    Francis Mariano

    07/29/2021, 6:46 PM
    Hello. With a new KMM project, the better way to connect a KMM module to iOS project is to use CocoaPods integration approach or
    embedAndSignAppleFrameworkForXcode
    gradle task approach?? Are there pros and cons for each from them?
    v
    l
    j
    • 4
    • 5
Powered by Linen
Title
f

Francis Mariano

07/29/2021, 6:46 PM
Hello. With a new KMM project, the better way to connect a KMM module to iOS project is to use CocoaPods integration approach or
embedAndSignAppleFrameworkForXcode
gradle task approach?? Are there pros and cons for each from them?
v

Viacheslav Kormushkin

07/29/2021, 7:02 PM
It depends on your current setup. If you already have an Xcode project that utilizes cocoapods then probably connecting KMM framework as a pod would be a good idea. If you want your KMM module to depend on third-party pods then again cocoapods work. If you don’t want to deal with cocoapods installation and setup then
embedAndSignAppleFrameworkForXcode
task is a solution
l

Landry Norris

07/30/2021, 3:19 PM
I noticed that my gradlew doesn't seem to have a task embedAndSignAppleFrameworkForXcode. I checked gradlew tasks. I have the plugin installed and active and am on a Mac.
j

John O'Reilly

07/30/2021, 3:20 PM
You need to be using at least Kotlin 15.20 to be able to use that.
l

Landry Norris

07/30/2021, 3:21 PM
I'm using 1.5.21
j

John O'Reilly

07/30/2021, 3:25 PM
I'm using in https://github.com/joreilly/MortyComposeKMM fwiw if you want to compare anything
View count: 4