https://kotlinlang.org logo
Docs
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
  • p

    Pamela Hill

    08/10/2022, 10:23 AM
    Hi Isuru! What is the specific error you are getting? I'll assist if I can, or you can directly file an issue with our Youtrack
    x
    6 replies · 2 participants
  • r

    Riccardo Tribbia

    08/10/2022, 10:59 AM
    Hi there, I’m approaching to KMM for my app agency. We’re developing native iOS and Android apps from 9 years and we’ve followed KMM from its start but we’ve not switched to it yet. I’ve evaluated KMM two years ago and last year but some limitations at the iOS side stopped me to start using it. Now I’m here again to see what changed in the past year and I see that many things have improved and the new memory management is in Beta (from 1st August) but I see that it’s not possibile to use pure-swift dependency yet. I’ve just investigated the roadmap and I haven’t seen any trace about it. In my opinion the swift community resources are still growing and many of them are very mature and stable - we use many of them in our apps in production and we feel confident about them; Apple itself is releasing new SDK only in pure swift (see CryptoKit). I don’t know if switching to KMM leads us to a path in which we couldn’t use official sdk or great and community supported dependencies because they’re pure swift. What do you think about it? Am I wrong? Is it just a step forward take any great pure swift sdk or pod and add objc bridge to use it in KMM? Please note our scenario: we aren’t a company with one or few apps in which we could decide about what to do and what to do not; we are an agency that develop 15-20 apps any years for different customers and we wish to be able to answer “yes” at customers question when asking “is it possible to do this?” - for example using a third-part service sdk or newest Apple sdk both with in pure swift. Thank you for any suggestion and advice
    r
    a
    7 replies · 3 participants
  • e

    eygraber

    08/11/2022, 12:06 AM
    I've had some users mention that they get an error when adding a dependency on my library. Does anything look off in my build.gradles.kts that could cause this? Error in 🧵
    r
    a
    5 replies · 3 participants
  • f

    Franco

    08/11/2022, 5:45 AM
    Hi everyone, I need some help understanding how local multiplatform libraries are built when we build our project. Our current set-up is: • We have a multiplatform library that we develop internally, which has targets for JVM and JS. • We have a server project that uses the library mentioned above and is developed using Kotlin/JVM. • We have a web app that also uses the library mentioned above and is developed using Kotlin/JS. When we build the web app using
    ./gradlew build
    the
    kotlin-js-store/yarn.lock
    file is created, which makes sense. However, when we build the server using
    ./gradlew build
    then the
    kotlin-js-store/yarn.lock
    file is also created, even though the server code is 100% Kotlin/JVM. My assumption is that the JS part of the multiplatform library is being built when we build the server, but shouldn't that be skipped autoamtically? My questions are: 1. Is the assumption above correct? Or is there something I'm missing? 2. Should we keep building the server using
    ./gradlew build
    or should we use a different Gradle task for this that doesn't build the JS code in the multiplatform library? Thanks for the help!
  • d

    Didier Villevalois

    08/11/2022, 7:54 AM
    @Uğur What problem?
    u
    4 replies · 2 participants
  • m

    Marcin Wisniowski

    08/11/2022, 1:44 PM
    Is there a KMM library similar to Retrofit or is using just Ktor the best bet?
    m
    o
    +3
    7 replies · 6 participants
  • b

    Ben Edwards

    08/11/2022, 3:50 PM
    So is multiplatform in Alpha, how long has it been around for? Very cool idea but as I am very new here will probably come back later.
    l
    k
    +2
    30 replies · 5 participants
  • v

    Venkataramanan Parameswaran

    08/11/2022, 4:57 PM
    hi i created a KMM library in my existing kotlin project. and when i use it without adding any other dependency in my xcode project it builds fine... but if i add coroutines or any other library (tested with ktor and kotlinx-serialization) my xcode project build fails.. but android works fine... ios build failed with the error stating that the particular dependency not found... can anyone please help me on this issue
    l
    6 replies · 2 participants
  • v

    Venkataramanan Parameswaran

    08/11/2022, 5:07 PM
    ./gradlew build
    fails...
  • g

    Gillian Buijs

    08/11/2022, 6:08 PM
    Is someone here with a M1 mac willing to help me out with a KMM Simulator issue? I don't have a M1 myself yet so unable to test... Basically the generated build.gradle.kts file for the platform module should build a framework that can be used on a M1 simulator. DM me if you can spare a few minutes to help me out? Thank you! Issue is here: https://github.com/buijs-dev/klutter/issues/4
    1 reply · 1 participant
  • x

    xiaobailong24

    08/12/2022, 7:47 AM
    Hi, folks. I want to call a
    #define FUNCTION()
    in objc header file from kotlin code, how should i do to cinterop it to kotlin klib?
    3 replies · 1 participant
  • m

    Michal Klimczak

    08/12/2022, 9:41 AM
    Which options of building the framework for ios are currently state of the art and which are not?: •
    assembleXCFramework
    •
    embedAndSignAppleFrameworkForXcode
    •
    packForXCode
    - this is deprecated afaik • cocoapods Any bigger issues with any of these methods?
    c
    p
    +2
    9 replies · 5 participants
  • r

    Rajput Art Studio

    08/13/2022, 6:26 PM
    Hi Team Facing one issue in Android ktor client. When sending multipart data with image then it throws error Multipart class not a serialised class. How to implement a ktor inbuild class with serialised annotation. Thanks in advance
    r
    2 replies · 2 participants
  • е

    Егор Аникеев

    08/14/2022, 2:33 PM
    Hi there! Сan anyone tell me if it is possible to turn off the kotlin runtime during the build ios framework, so that it can be included later in another kmm-project?
    k
    1 reply · 2 participants
  • a

    adjpd

    08/14/2022, 9:41 PM
    Is it possible to use non-kmm libraries, like Mockito, for use in
    commonTest
    ?
    b
    j
    +3
    20 replies · 6 participants
  • x

    xxfast

    08/15/2022, 3:58 AM
    if I jump to declaration on the
    import
    above, i only get directed to an empty
    .h
    file.
    b
    2 replies · 2 participants
  • c

    coolcat

    08/15/2022, 12:34 PM
    Does anybody know of a way to run unit tests on common code, using MockK, on a Mac? Common unit tests build and run OK on Windows machines. But on a mac they won’t run because MockK is not compatible with Kotlin Native. I would be happy for these tests to run on JVM only
    m
    s
    20 replies · 3 participants
  • s

    Sam

    08/15/2022, 1:27 PM
    Reposting since originally posted on a weekend and got buried
    a
    3 replies · 2 participants
  • d

    Djordje Mutavdzic

    08/15/2022, 3:09 PM
    Anyone knows if it's possible to implement OpenCV in android studio? Where to start? Will it also work on iOS?
    j
    s
    5 replies · 3 participants
  • k

    Kieren Searle

    08/15/2022, 8:16 PM
    Hi. I'm having some trouble getting c interop to work with my KMM library.
    l
    33 replies · 2 participants
  • m

    Mendess

    08/16/2022, 12:55 PM
    is it okay to freeze a mutable shared flow?
    l
    a
    2 replies · 3 participants
  • d

    Didier Villevalois

    08/16/2022, 2:50 PM
    Hoping to get an answer by cross-posting.
  • c

    Ciaran Sloan

    08/16/2022, 3:28 PM
    I can run the same project in bumblee just fine, and can run all my tests in
    androidTest
    without issue (im using turbine in there to test my state flows). However when I open the same project in chipmunk, the classes in
    commonMain
    are not accessible in
    androidTest
    and wont resolve
    l
    j
    7 replies · 3 participants
  • m

    Matti MK

    08/17/2022, 8:11 AM
    I’m looking to implement Sentry in my KMM project (Android & iOS targets), but from what I can gather by Googling and searching this channel is that Sentry support is not very mature. Some resources I found: KMM implementation • Experimental Sentry SDK for Kotlin Multiplatform, this apparently allows adding sentry to KMM shared module, instead of native implementations Native implementation • Add Sentry to native projects • Kermit’s experimental Sentry support • NSExceptionKt for Sentry, experimental Has anyone successfully implemented Sentry in a KMM project and how did you approach the implementation?
    s
    k
    +1
    12 replies · 4 participants
  • a

    adjpd

    08/17/2022, 4:19 PM
    I'm trying to use kotlin 1.7.10. I'm on the latest plugin version. I get this error
    Could not find :kotlin-native-prebuilt-macos-x86_64:1.7.10
    Any ideas?
  • v

    Venkataramanan Parameswaran

    08/17/2022, 5:03 PM
    hi .. when calling shared kotlin suspend functions from swift code, we get a completion block with data and error... and i didn't see any situation in which the error would be NOT NIL. can anyone please explain when will i get the error?
    m
    r
    5 replies · 3 participants
  • a

    Alejandro Moya

    08/17/2022, 6:49 PM
    Good afternoon, quick question, I’m implementing some tests on my kmm project and wanted to save the json payloads on separate files, is there a way to load those? from the jvm test env?
    j
    10 replies · 2 participants
  • j

    juh juh

    08/17/2022, 9:23 PM
    Hello, I want to know, which data structure should I use in JS target so it will get compiled into a native JS array without extra overhead? Mainly, I need access to `push`/`pop` and other js-exclusive array methods
    j
    j
    +1
    9 replies · 4 participants
  • j

    juh juh

    08/17/2022, 10:33 PM
    After building kotlin/multiplatform project via
    gradlew build
    , where can I find generated JS file? I searched all over
    build
    folder but couldn't find any. a lot of build data for JS is generation, but no actual JS file is found, and I get no errors either
    g
    2 replies · 2 participants
  • x

    xxfast

    08/18/2022, 4:45 AM
    Looks like enums from depending modules are not exported by default (even when the dependency is exported). Not sure why? 🤔
    dependencies {
      api(project(":module-where-my-enum-lives"))
    }
    e
    g
    +1
    6 replies · 4 participants
Powered by Linen
Title
x

xxfast

08/18/2022, 4:45 AM
Looks like enums from depending modules are not exported by default (even when the dependency is exported). Not sure why? 🤔
dependencies {
  api(project(":module-where-my-enum-lives"))
}
e

eygraber

08/18/2022, 6:00 AM
I think this is behind a flag to avoid unexpected side effects, like massive binaries, etc...
x

xxfast

08/18/2022, 6:13 AM
yeah, looks like its not just enums - any classes that are not directly referenced in the original module is not exported by default
g

Grégory Lureau

08/18/2022, 7:35 AM
It's exported on my project 🤔 I use binaries.executable() and
api(project(":..."))
in commonMain dependencies if this can help. (EDIT: I thought about JS but looks like you're working with iOS, my bad)
s

sergey.bogolepov

08/18/2022, 7:55 AM
https://kotlinlang.org/docs/multiplatform-build-native-binaries.html#export-dependencies-to-binaries
x

xxfast

08/18/2022, 9:54 AM
I have this setup
// :app
kotlin {
  ..
  listOf(
    iosX64(),
    ..
  ).forEach { target ->
    with(target) {
      binaries {
        framework {
          baseName = "App"
          ..
          export(project(":search"))
        }
      }
    }
  }
  ..
  sourceSets {
    val iosX64Main by getting
    ..
    val iosMain by creating {
      dependsOn(commonMain)
      iosX64Main.dependsOn(this)
      ..

      dependencies {
        ..
        api(project(":search"))
      }
    }
  }
}
i noticed that once i reference this model anywhere from
:app
module, it is immediately exported. If there is not reference to it, it is not exported
View count: 20