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

    ade

    11/14/2022, 10:26 AM
    Looking to exchange some ideas around a strange KMM behaviour. We had this function in a commonMain source for Android and iOS code;
    private fun String.strip() = this
        .replace(oldValue = "https://", newValue = "", ignoreCase = true)
        .replace(oldValue = "http://", newValue = "", ignoreCase = true)
        .substringBefore(delimiter = "?")
    which was called from the same file on a String. This has been working fine until recently. Now suddenly, the function does nothing ("https://" prefix is not removed from a string) on Android but works like before on iOS. I think it was after bumping to Kotlin 1.7.20, AGP 7.3 and compileSdk 33. What could be happening here? Theory: Is something causing it to call through to the Java String.strip() function instead, which was added in Java 11? Does it have to do with desugaring?
    m
    • 2
    • 10
  • j

    John Huang

    11/14/2022, 7:42 PM
    Regard https://kotlinlang.slack.com/archives/C3PQML5NU/p1663865511120329 , is the Kotlin/JS compiler open source? How can we get this fixed?
  • a

    Antonin Porta

    11/15/2022, 9:06 AM
    Hello, is there any kmm support for what this project does ? https://github.com/yshrsmz/BuildKonfig
    j
    • 2
    • 3
  • k

    kevin.cianfarini

    11/15/2022, 5:38 PM
    https://kotlinlang.slack.com/archives/C0NBD4UF8/p1668533536722269
    s
    • 2
    • 3
  • s

    simon.vergauwen

    11/16/2022, 8:31 AM
    Hey everyone 👋 I'm starting to see this on all my repos on Github Actions, including Arrow.
    Invalid device: Apple Watch Series 5 - 44mm
    8405 Any ideas how to fix this? It's been blocking a couple projects, and I've tried a couple things but none seems to work. If I check the MacOs runner to list the simulators it lists this specific simulator, and it's amongst the list 🤔
    m
    r
    j
    • 4
    • 21
  • a

    An Tran

    11/16/2022, 9:08 AM
    Hey everyone, how can I access
    Kotlin enum
    from Swift
    a
    • 2
    • 4
  • a

    alexfacciorusso

    11/16/2022, 12:43 PM
    Hi all! I’m trying to make a multiplatform library which is pure Kotlin (aka no platform-specific code), exported for Android too. To be honest, it is a JVM-pure library so it doesn’t even need to have an Android platform per-se, the problem is if I don’t add it, if I then add it as a dependency for a mpp project that has also Android, it won’t automatically add the jvm dependency to the Android project, at the end not compiling at all
    j
    a
    +2
    • 5
    • 25
  • w

    Werner Altewischer

    11/16/2022, 8:23 PM
    I have a question/issue with the new native memory manager. In the old implementation and with Swift native memory management (reference counting) if an object is never used in any thread but the main thread it will also be deallocated in the main thread. With the new memory manager this does not seem to be the case because the garbage collector runs in a separate thread and it causes issues for custom implementations of deinit which require the code to be executed on the main thread (such as UIView/UIViewController instances). What is the best practice in this regard?
    h
    p
    • 3
    • 7
  • j

    John Huang

    11/16/2022, 10:42 PM
    Any change to add GoLang support? I know it is used for server. It would be nice to share business logic between server and client
    l
    j
    • 3
    • 5
  • s

    Srijit Saha

    11/17/2022, 4:38 AM
    Hey guys, i have a question, how do we handle Either response in iOS for KMM Like if it's Either< Type_A , Type_B > How do i get the values of Type_A and Type_B ?
    s
    a
    w
    • 4
    • 12
  • s

    Slackbot

    11/17/2022, 8:50 AM
    This message was deleted.
    m
    s
    • 3
    • 2
  • m

    marcinmoskala

    11/18/2022, 7:30 AM
    I am trying to grasp and explain the difference between platform and target. Is this correct?
    Kotlin/JVM, Kotlin/JS and Kotlin/Native are three technologies used to compile Kotlin code into different platforms. For instance, Kotlin/JVM can be used to compile Kotlin code for Android or for purely JVM platform, and Kotlin/Native can be used to compile Kotlin code for iOS, watchOS or Android NDK platform. For many of those platforms, there are multiple targets, like when we compile with Kotlin/Native to iOS platform, we can Apple iOS on ARM64 or Apple iOS simulator on x86_64.
    e
    a
    +3
    • 6
    • 10
  • d

    doubov

    11/18/2022, 9:12 PM
    I'm trying to understand what the repercussions of
    w: duplicate library name
    warnings are. I recently upgraded one of the libraries (Turbine) to the latest version. It was previous using
    1.6.1
    coroutine version, but the latest version upgraded coroutines to
    1.6.4
    . Our app is using
    1.6.3
    version and only after upgrading the Turbine library did we start seeing the duplicate library warning. Did this start happening because Turbine is using a later version of the coroutines library? With the
    -Werror
    flag set, compilation started failing and I'm trying to understand if I should be looking for a way to suppress this warning or will that come back to bite us in the future?
    m
    • 2
    • 1
  • d

    Daniel

    11/18/2022, 11:08 PM
    I want to implement a food delivery KMM app. What I can use for geospatial/geolocation data for my KMM project ( android/swiftui) that will work for both?
    k
    w
    • 3
    • 7
  • d

    Daniel

    11/19/2022, 6:06 PM
    I will want to check if the customer location(lat long) is inside a polygon(area)
    b
    m
    +2
    • 5
    • 8
  • d

    Daniel

    11/20/2022, 3:10 PM
    Can google places be shared in KMM (swiftui and kotlin)? Just google places, not google maps
    h
    v
    b
    • 4
    • 3
  • p

    Piotr Krzemiński

    11/21/2022, 10:10 AM
    how can I use
    value class
    in a multiplatform project? Previously I used
    inline class
    but I see it’s deprecated now. Using
    value class
    produces an error “Value classes without @JvmInline annotation are not supported yet” and I cannot use
    @JvmInline
    in a multiplatform project obviously. What’s the recommended path forward? Keep using
    inline class
    ? What’s the plan of proper multiplatform support for
    value class
    ? Once we clarify all of it, I’ll propose some changes to the docs: https://kotlinlang.org/docs/inline-classes.html
    h
    j
    c
    • 4
    • 9
  • m

    Mihai Voicescu

    11/21/2022, 10:32 AM
    Did anybody encounter problems when using the published repository in common code? Platform-specific published code seems to work (-jvm, -js etc) but the common module seems to be empty. Everything seems to be fine when using the code inside the project (with implementation(project(":utils")) ). I am using this build file:
    build.gradle.kts
    b
    • 2
    • 11
  • j

    Jason Millard

    11/21/2022, 2:57 PM
    Hello. We are working on an iOS app that has multiple extensions, (Notification, Notification Content, Widget). I’m trying to use the “shared” framework in each of them and have not been successful. At first I added the
    :shared:embedAndSignAppleFrameworkForXcode
    to the Run Script for the widget. Then I manually had to remove the framework in the extension, otherwise TestFlight wouldn’t accept the binary. I then went to do the same for the next extension, and started getting sporadic build success and failures. I’m guessing Xcode is compiling multiple things at the same time which might be causing issues? I decided to switch to CocoaPods route thinking I’d get the one framework I could easily add to each of the targets. Again, this worked for one extension, and then sporadic build success and failures with multiple extensions. Is there any examples out there for best practice when sharing KMM between multiple targets? UPDATE: worked on this all day, and in my CI, turns out I needed to run
    ./gradlew podInstall
    first before doing anything vs manually doing
    pod install
  • k

    krzysztof

    11/21/2022, 4:13 PM
    I’m using
    native.cocoapods
    plugin and I try to configure it in a way that
    publish
    task would create a
    .podspec
    file and
    .xcframework
    in given hierarchy:
    - buildDir/
      - File.podspec
      - frameworks/
        - framework.xcframework
    Does anyone have an idea how to achieve that? Looking at
    cocoapods
    DSL and cannot find anything
    • 1
    • 1
  • h

    Hossein Amini

    11/21/2022, 6:21 PM
    Hi all Is there any way to modularize a KMM project? I want to follow the clean architecture so in the bussiness layer I want to have 2 KMM modules. One for the data layer and the other one for the domain layer
    b
    a
    • 3
    • 36
  • d

    Daniel

    11/21/2022, 7:22 PM
    Hello. I am trying to use FCM in my KMM app. Does anyone know how I can do it in the shared module? Thanks 🙂
  • d

    Daniel

    11/21/2022, 7:23 PM
    I am doing this because its the only way that I know I can send push notifications when my KMM app its closed
    a
    • 2
    • 1
  • j

    Johann Pardanaud

    11/21/2022, 11:12 PM
    Is there any solution to
    expect
    a function with different returns types in the actual implementations? I have
    suspend fun makeRequest(): Unit
    for my native target, but Kotlin doesn’t allow to apply
    @JsExport
    due to the suspend keyword so I’ve created
    fun makeRequest(): Promise<Unit>
    for the JS target. However, due to the different return types I can’t find any way to
    expect
    in my common code the
    makeRequest
    function. Is there any workaround?
    m
    • 2
    • 4
  • p

    Piasy

    11/22/2022, 1:04 AM
    Hi all, I want to create and publish a multiplatform library, just like the tutorial https://kotlinlang.org/docs/multiplatform-library.html , but I have some objc native code and a static framework dependency. I managed to build my KMP project into a dynamic framework which could work on iOS Xcode project directly, but how could I make it available by another KMP project and make them all useable in iOS Xcode project (of course I need to publish my library into maven local or maven central)?
  • c

    Christian Würthenr

    11/22/2022, 1:05 PM
    I'm trying to add a cocoapod dependency to my project, but the
    import cocoapods.*
    package does not become available. If I remove the import directive the project builds find and I also see the cocoapod files in the build folder.
    cocoapods {
            summary = "CocoaPods test library"
            homepage = "<https://github.com/JetBrains/kotlin>"
            version = "1.0"
            ios.deploymentTarget = "14.1"
            pod("AFNetworking") {
                version = "~> 4.0.1"
            }
        }
    That's my setup, but I can't import
    import cocoapods.AFNetworking.*
    • 1
    • 2
  • k

    Konstantin Tskhovrebov

    11/22/2022, 1:31 PM
    If someone hasn't known this feature 😉 https://github.com/terrakok/kmm-awesome
    Screen Recording 2022-11-22 at 12.05.16.mov
  • p

    Paulo Cereda

    11/22/2022, 7:01 PM
    This might be interesting: stable Kotlin type sharing with Rust: https://github.com/1Password/typeshare 🥳
  • s

    Slackbot

    11/22/2022, 11:03 PM
    This message was deleted.
  • m

    Mychael Koelfat

    11/23/2022, 9:36 AM
    Hi everyone! I've been busy with a project implementing Kotlin Multiplatform. However, I only just got everything ready for iOS testing (Macbook, IPhone, Apple ID etc, etc..) Now I am trying to access my shared folder, following the documentation: https://kotlinlang.org/docs/multiplatform-mobile-integrate-in-existing-app.html#connect-the-framework-to-your-ios-project Following the steps I try to build the project but I get the error
    Framework not found shared
    I dont exactly understand what I did wrong. However, the search path given is
    $(SRCROOT)/../shared/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)
    though here the build folder doesnt even exist in one version, though it does on my windows laptop. Here however, the xcode-frameworks folder doesnt exist either. Does anyone have any idea, or can anyone give me any insight on what's going on?
    k
    • 2
    • 1
Powered by Linen
Title
m

Mychael Koelfat

11/23/2022, 9:36 AM
Hi everyone! I've been busy with a project implementing Kotlin Multiplatform. However, I only just got everything ready for iOS testing (Macbook, IPhone, Apple ID etc, etc..) Now I am trying to access my shared folder, following the documentation: https://kotlinlang.org/docs/multiplatform-mobile-integrate-in-existing-app.html#connect-the-framework-to-your-ios-project Following the steps I try to build the project but I get the error
Framework not found shared
I dont exactly understand what I did wrong. However, the search path given is
$(SRCROOT)/../shared/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)
though here the build folder doesnt even exist in one version, though it does on my windows laptop. Here however, the xcode-frameworks folder doesnt exist either. Does anyone have any idea, or can anyone give me any insight on what's going on?
k

Konstantin Tskhovrebov

11/23/2022, 1:57 PM
Make sure that your shared framework has default name. because `
embedAndSignAppleFrameworkForXcode
name dependent task. or check all your tasks in terminal
./gradlew tasks
View count: 13