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

    Matouš Skála

    10/21/2021, 9:41 AM
    I’m trying to opt-in export of KDoc comments according to https://kotlinlang.org/docs/whatsnew1520.html#opt-in-export-of-kdoc-comments-to-generated-objective-c-headers However, after adding
    kotlin {
        targets.withType(org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget) {
            compilations.get("main").kotlinOptions.freeCompilerArgs += "-Xexport-kdoc"
        }
    }
    to build.gradle, I get the following error during gradle configuration:
    Caused by: groovy.lang.MissingMethodException: No signature of method: build_85rawsls4t4om6gyhg7yes7kk.kotlin() is applicable for argument types: (build_85rawsls4t4om6gyhg7yes7kk$_run_closure6) values: [build_85rawsls4t4om6gyhg7yes7kk$_run_closure6@6b90c290]
    Possible solutions: notify(), toString(), toString(), toString(), toString(), split(groovy.lang.Closure)
    Any hint what could be wrong?
    g
    • 2
    • 2
  • r

    Ron

    10/21/2021, 1:06 PM
    Hi! I want to create an immutable object in kotlin multiplatform (ios/android) so it could be shared between threads in swift. can anyone help me? I tried to add
    @SharedImmutable
    to properties in a class but got this error:
    SharedImmutable is applicable only for top level declarations
    . Also tried to run
    .freeze()
    but this function is not available. what am I missing?
    m
    • 2
    • 2
  • e

    edenman

    10/21/2021, 8:00 PM
    anybody know if the KMM plugin is getting an update soon? Really frustrating to have it not working on latest AS
    a
    • 2
    • 7
  • s

    Sylvain Patenaude

    10/21/2021, 8:22 PM
    Hi folks, A client of our multiplatform libraries just told us they encountered a problem with our library for android, problem that apparently started with kotlin >= 1.4. (Stacktrace attached as a text file.) It looks like an issue with
    UByteArray
    where some generated method can't find a static method or something like that. Did something happen with unsigned types with kotlin >= 1.4? Thanks in advance, Sylvain
    StacktraceJavaKotlin.txt
    • 1
    • 1
  • j

    jimmyt

    10/22/2021, 12:45 AM
    I'm working on a KMM project with CocoaPods dependencies. For some reason unknown to me, the iOS Deployment Target for each Pod target on which my project depends is being set to 8.0 each time I try to sync the project, but the range of supported deployment target versions is 9.0 to 14.5.99, so each time I try to sync the project, it fails on the shared:podBuild(PodName)Iphonesimulator task. I tried opening up the project in Xcode and changing the versions manually, but this does not work because the iOS Deployment Target is changed back to 8.0 each time I attempt to sync the project. What else can I do about this?
    m
    • 2
    • 7
  • x

    xiaobailong24

    10/22/2021, 1:07 AM
    Hello, how to use
    annotationProcessor
    or
    kapt
    with jvm target but without android target?
    i
    • 2
    • 2
  • p

    Pavel Dektev

    10/22/2021, 7:57 AM
    Hi everyone! I develop KMM app and I can’t run ios project from Android Studio. Maybe someone already had similar issue? From XCode I can build and launch app without any problem
    g
    g
    • 3
    • 11
  • c

    coolcat

    10/22/2021, 4:10 PM
    I am currently having difficulty building my KMM Android app from within Android Studio on my Mac. The iOS build works within Xcode, and the Android build also works OK on a non-Mac machine. The error is:
    Could not determine the dependencies of task ':shared:cinteropSharedIos'.
    > Could not resolve all dependencies for configuration ':shared:iosSharedCInterop'.
       > Authentication scheme 'all'(Authentication) is not supported by protocol 'file'
    Any help appreciated.
    k
    • 2
    • 4
  • k

    kenkyee

    10/22/2021, 5:31 PM
    For folks doing KMP w/ iOS and MVI, how do you handle iOS app state restoration (Android's savedstatehandle equivalent)? No luck searching this channel for "iOS app state restoration" which I thought was the right term for this...
    m
    k
    +4
    • 7
    • 29
  • c

    cedric

    10/22/2021, 5:40 PM
    Something I haven't seen in the various articles/presentations about Kotlin switching to a native WASM back end is: what was found insufficient in the existing LLVM back end? LLVM performs some really incredible optimizations in the assembly it generates, and it gets better every day, so I wonder if the Kotlin team can keep up with all the efforts going into LLVM, and whether it's time well spent...
    r
    • 2
    • 3
  • k

    Kirill Langer

    10/22/2021, 6:24 PM
    Is there any way to use kotlin specific libraries for Kotlin Multiplatform Mobile common business logic? I have a dependency on Amplify that works fine for just android but doesn't support Kotlin Multiplatform Mobile. I am trying to use it for both ios and android GraphQL queries and subscriptions. I can't add this to common dependencies. Is this possible or do we need to switch to something like apollo for KMM for our GraphQL queries and subscriptions?
    🇳🇴 1
    i
    c
    • 3
    • 3
  • v

    Vitaliy Zarubin

    10/22/2021, 7:37 PM
    For several evenings I have been unable to assemble the KMM default project on m1 in AppCode. Default project Android Studio crash after run application in simulator. Sadness. Yearning.
    m
    • 2
    • 2
  • d

    Dmitriy Tarasevich

    10/23/2021, 12:28 PM
    Hello, how Is everyone publishing Android artifacts from their KM projects. We have been using https://github.com/kezong/fat-aar-androidfat-aar-android since the start but it seems like kotlin 1.5.31 is incompatible with it. What are some other approaches I can try?
    • 1
    • 2
  • f

    fvink

    10/23/2021, 7:08 PM
    for those who use AppCode for KMM projects, how do you write UI in it? i know there’s a solution for swiftui preview, but i haven’t been able to find anything for android. any options for xml or compose preview?
    n
    • 2
    • 2
  • p

    Philip Dukhov

    10/24/2021, 7:12 PM
    My generic module depends on another KMM module. This second module, let's say, has two objects, both subclasses of a sealed class, so I can't put them in different modules. 1. One of them has to be included in the iOS framework, so I force this module to be included as shown here. 2. The second object must be reused in another module, so I can't make it internal, but I need to exclude it from the iOS framework. Is there any way to do this?
    b
    r
    • 3
    • 4
  • m

    Michael Clancy

    10/25/2021, 10:11 AM
    Hi there, I have asked a similar question concerning OpenCV a few days ago. I am looking to call OpenCV from ios via Kotlin Native. I have found that OpenCV now provides an objective C and swift wrapper as of 4.4.0. Can anyone tell me whether it is currently possible to call Objective C code from native, where the objective C code is dependent on C++? Thanks (Also lmk if this is better suited for the Kotlin Native channel wasn’t sure)
    • 1
    • 1
  • p

    Piotr Prus

    10/25/2021, 11:58 AM
    I am trying to introduce DDD in kotlin multiplatform mobile project. I have created 2 modules:
    infrastructure
    that contains repositories, apis, responsesDTO, etc and
    domain
    that contains usecase interfaces and domain specific data classes. I want ios and android client to know only
    domain
    , without any idea of
    infrastructure
    , so in the build.gradle of my
    shared
    I have:
    api(project(":domain"))
                    implementation(project(":infrastructure"))
    The issue I am facing: The ios client do not see any of domain classes if theses are not used in
    shared
    . Is there any way to force compilation of these? Android client sees all of these classes correctly and can make a use of them.
    r
    • 2
    • 2
  • l

    Lital Amos

    10/25/2021, 3:12 PM
    Hi We’re new to KMM and are just working on our first KMM modules. All was working well for us but after pulling the newest version of our iOS app, gradle build is now failing with this error:
    Executing of 'pod install' failed with code 1.
    Error message:
    
    Please, check that file "/Users/workstation/Documents/Workspace/iOS.App/Podfile" contains following lines in header:
    source '<https://cdn.cocoapods.org>'
    
    Please, check that each target depended on connectivity contains following dependencies:
    I tried changing our Podfile that currently has
    source '<https://github.com/CocoaPods/Specs.git>'
    this to use the CDN url, ran pod repo update and pod install but this does seem to help. Any insights on how to resolve this?
    m
    • 2
    • 5
  • y

    Yashar

    10/25/2021, 3:18 PM
    This might be an old issue already solved in
    0.7.1
    https://kotlinlang.slack.com/archives/C3SGXARS6/p1528475089000678 but I wanted to get another opinion from the community. @kpgalligan (I was told you might be familiar with this). Our dynamic scanner has identified a use of private iOS API:
    Frameworks/Core.framework/Core: _unsymbolicated_function accessed _NSBlock
    within a KMP library module, which would block the app from getting published in the App store. Upon some digging, I came across this similar old issue on github with fix already merged. So my question is, has anyone else come across this? And if so, is this issue already addressed and have folks been fine publishing to App store without rejections?
    k
    • 2
    • 3
  • k

    Kareem Radwan

    10/25/2021, 3:45 PM
    hi there after development my shared module by KMM I want extract kmm module as apple framework and add it as pod on external library but when I run the iOS app and
    startKoin
    I got an Exception
    Uncaught Kotlin exception: kotlin.IllegalStateException: KoinApplication has not been started
    any one have an experience on this way before ?
    m
    • 2
    • 7
  • j

    John O'Reilly

    10/25/2021, 4:59 PM
    Anyone know of a Kotlin Multiplatform project with a recent working watchos client implementation?
    r
    • 2
    • 10
  • y

    Yehonatan Levi

    10/25/2021, 5:30 PM
    i am wondering, havne't anyone thought of writing switui code in kotlin directly?
    b
    i
    +3
    • 6
    • 10
  • e

    Eirik Vale Aase

    10/25/2021, 9:53 PM
    macOS Monterey has been released, anyone tested it out with a KMM multiplatform app? Any issues?
    👍 4
    👀 2
    s
    l
    • 3
    • 12
  • x

    xiaobailong24

    10/26/2021, 9:11 AM
    Hello, I have an ios oc header file to cinterop in kmm:
    #ifndef socket_swift_bridge_h
    #define socket_swift_bridge_h
    
    // <https://github.com/socketio/socket.io-client-swift>
    @import SocketIO;
    
    #endif /* socket_swift_bridge_h */
    then get error:
    Exception in thread "main" java.lang.Error: /xxx/socket_swift_bridge.h:14:1: error: use of '@import' when modules are disabled
    	at org.jetbrains.kotlin.native.interop.indexer.UtilsKt.ensureNoCompileErrors(Utils.kt:152)
    	at org.jetbrains.kotlin.native.interop.indexer.IndexerKt.indexDeclarations(Indexer.kt:1003)
    	at org.jetbrains.kotlin.native.interop.indexer.IndexerKt.buildNativeIndexImpl(Indexer.kt:992)
    	at org.jetbrains.kotlin.native.interop.indexer.NativeIndexKt.buildNativeIndex(NativeIndex.kt:91)
    	at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLib(main.kt:268)
    	at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.interop(main.kt:76)
    	at org.jetbrains.kotlin.cli.utilities.InteropCompilerKt.invokeInterop(InteropCompiler.kt:45)
    	at org.jetbrains.kotlin.cli.utilities.MainKt.mainImpl(main.kt:38)
    	at org.jetbrains.kotlin.cli.utilities.MainKt.main(main.kt:60)
    so, how to solve it? thx
    v
    • 2
    • 6
  • m

    Matti MK

    10/26/2021, 9:56 AM
    Is
    setAllowsCellularAccess
    anymore relevant for networking with ktor on iOS KMM, for example, as seen in the sample code linked below? I’m using the default engine (https://ktor.io/docs/http-client-engines.html#default) and network requests seem to go through just fine on WiFi and cellular which makes me wonder if there’s some edge case that would require explicitly calling
    setAllowsCellularAccess
    with
    true
    ? https://github.com/Kotlin/kmm-production-sample/blob/master/shared/src/iosMain/kotlin/com/github/jetbrains/rssreader/core/IosHttpClient.kt#L11
    h
    • 2
    • 3
  • s

    Stefan Oltmann

    10/26/2021, 10:21 AM
    What alternatives can you recommend to Ktor client for shared network code (iOS, Android, JVM)? (I tried Ktor, but is really has a lot of bugs and is slow to adopt changes like the M1 transition. I don't like it as all.)
    f
    w
    +2
    • 5
    • 8
  • b

    Brian Donovan

    10/26/2021, 2:48 PM
    Hey guys the KMM plugin doesn’t come up for me. I am on chipmunk 2021.2.1 Canary 2
    m
    • 2
    • 5
  • j

    Jim

    10/26/2021, 6:59 PM
    👋 can I control where kotlin-native-prebuilt-macos-x86_64-1.5.31.tar.gz and similar are downloaded from? I'm required to use an internal repository
    a
    • 2
    • 3
  • b

    Brian Donovan

    10/26/2021, 7:49 PM
    I’m trying to add these dependencies, any help please
    c
    k
    x
    • 4
    • 11
  • a

    Andrey Chernov

    10/27/2021, 7:35 AM
    Hello! Does anyone has positive experience with any gRPC client and generate network calls and messages code from .proto files in mobile common code? We look to
    wire
    (https://github.com/square/wire) now but it’s have android official sample only
    k
    s
    • 3
    • 4
Powered by Linen
Title
a

Andrey Chernov

10/27/2021, 7:35 AM
Hello! Does anyone has positive experience with any gRPC client and generate network calls and messages code from .proto files in mobile common code? We look to
wire
(https://github.com/square/wire) now but it’s have android official sample only
Okay, wire can’t be used. There’s no iOS implementation for grpc client
k

Konstantin Tskhovrebov

10/27/2021, 5:08 PM
https://github.com/streem/pbandk ?
a

Andrey Chernov

10/28/2021, 3:44 AM
This one can generate only model files by .proto and haven’t gRPC client too, so sad(
s

saket

10/28/2021, 4:34 AM
not sure if useful but wire can generate swift: https://code.cash.app/wire-support-for-swift-part-1
👀 1
View count: 10