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
ios
  • l

    Landry Norris

    05/05/2022, 5:59 PM
    I have a project set up following https://kotlinlang.org/docs/native-cocoapods.html#add-and-configure-kotlin-cocoapods-gradle-plugin that worked fine last week, but now when I build, the ‘shared’ framework in the cocoapods folder only has a header file named ‘placeholder.h’ with nothing useful in it. My app won’t compile anymore, since XCode can’t find any of the classes in my KMM library.
    k
    • 2
    • 4
  • l

    Landry Norris

    05/13/2022, 6:53 PM
    I have a project with two modules that both use cocoapods. They both depend on the Intercom pod and are set up nearly identically. One of them builds just fine, but the other always fails when commonizing the cinterop for Intercom with this message
    Unresolved classifier: cocoapods/Intercom/ICMHelpCenterCollectionContent
    What should I be looking for to figure out why this fails for only one of the modules?
    • 1
    • 2
  • r

    ribesg

    05/20/2022, 10:48 AM
    > Task :iosX64Test
    Invalid device: iPhone 12
    java.lang.IllegalStateException: command '/usr/bin/xcrun' exited with errors (exit code: 148)
    Yeah I don’t have an iPhone 12 simulator, but why does it try running my tests on it? There are other simulators available, why does it want to use something that isn’t there?
    n
    j
    • 3
    • 10
  • a

    Allen

    05/22/2022, 7:50 PM
    Hello guys, I am working in Kmm library. I am in iOS part and using cocoapods as dependency manager. I am new in ios and kmm. I am reading the cocoapods doc in kotlin. I am adding my gradle code in the thread. I am understand that my cocoapod code is generating .podspec file. But there is no instructions given in doc to generate framework. I want to use pod private spec, but I don't understand what I need to share in the repo. Can someone help me how can I generate framework and what files I can share in private pod sec repo. Any working examples will be great. Thanks
    👀 1
    r
    v
    m
    • 4
    • 8
  • l

    Landry Norris

    05/30/2022, 4:10 PM
    [Solved] In the past few days, I’ve noticed that when I build an iOS binary, I’m getting a failure at linkDebugFrameworkIosArm64. More details in 🧵
    • 1
    • 4
  • p

    Paddy O'Brien

    05/30/2022, 4:26 PM
    Is there a way to cause compilation to fail if the deployment target is iOS 12 and the Kotlin native code references a class or method from a later os version? I have tried this with no success, code compiles and the app crashes on launch.
    a
    • 2
    • 3
  • p

    Paddy O'Brien

    06/02/2022, 2:45 PM
    The docs say that
    suspend
    functions are available as functions with callbacks and
    async
    functions in swift. Unfortunately this means that interfaces with
    suspend
    functions in Kotlin are exported as protocols with both
    async
    and callback requirements in Swift. And
    async
    is not supported for iOS 12 🙃 Is it possible to generate only the callback definitions?
    • 1
    • 2
  • p

    Pat Teruel

    06/03/2022, 2:19 AM
    quick question: Is HealthKit class
    HKVerifiableClinicalRecordQuery
    supported? I can’t seem to access it through Kotlin. Thank you.
    r
    • 2
    • 2
  • r

    ribesg

    06/14/2022, 8:13 AM
    How do you get rid of these errors? Happens every time I update XCode in a project with a Kotlin cocoapods dependency.
    "$REPO_ROOT/../../../../private/var/folders/6l/fxc2038542q1pfrjs6br35pw0000gn/T/wrap1902loc/gradlew" -p "$REPO_ROOT" $KOTLIN_PROJECT_PATH:syncFramework                     -Pkotlin.native.cocoapods.platform=$PLATFORM_NAME                     -Pkotlin.native.cocoapods.archs="$ARCHS"                     -Pkotlin.native.cocoapods.configuration="$CONFIGURATION"
    /Users/ribesg/Library/Developer/Xcode/DerivedData/events-fovucgtiducodmfkizhdqhwxwlxd/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/events.build/Script-6142A0FCC479B03E270A05C98643CC12.sh: line 8: /Users/ribesg/XcodeProjects/events/xcode/Pods/../../../../../../private/var/folders/6l/fxc2038542q1pfrjs6br35pw0000gn/T/wrap1902loc/gradlew: No such file or directory
    • 1
    • 3
  • s

    Slackbot

    06/15/2022, 6:06 AM
    This message was deleted.
    :not-kotlin: 1
    r
    l
    • 3
    • 2
  • r

    ribesg

    06/15/2022, 2:52 PM
    I updated to Kotlin 1.7.0 and now the cocoapods plugin tries to build a dependency for armv7 for some reason, why? That dependency doesn’t support armv7.
    l
    • 2
    • 4
  • m

    Matthew Murray

    06/21/2022, 6:54 PM
    Hi guys, I’m having trouble doing a
    switch
    statement with Kotlin/Native enums in Objective-C. I’m getting the error
    Statement requires expression of integer type ('NtvCoreRateType *' invalid)
    . It seems that Kotlin enum classes don’t get converted into proper enums in objective-C, so I’m wondering if its at all possible to do a switch statement with them? And if not, what is the expected way to compare them?
    n
    • 2
    • 4
  • a

    ariedov

    06/22/2022, 1:17 PM
    Hello good people. I am looking for some ways to publish a KMM library for iOS without sharing the source code. Any tips or ideas are very welcome.
    l
    s
    • 3
    • 5
  • l

    Landry Norris

    06/28/2022, 4:46 PM
    I am working on a KMM library that is distributed as an xcframework for iOS and have an Objective-C dynamic framework that I depend on using cinterop currently. I created a def file that defines linker flags to link against the Obj-C framework. When I integrate this into my app (also KMM), I can use gradle’s implementation(project), but I still have to manually embed the frameworks into the app using XCode. Is there a way to have KMM embed the Obj-C frameworks with my KMM framework so I don’t have to embed them in the final app in XCode?
  • d

    darkmoon_uk

    06/29/2022, 1:07 AM
    I have a need to expose a newer Swift-only API to Kotlin Multiplatform. I understand I will need to write an Objective-C wrapper to re-expose it via ObjC ABI. Can anyone share experience to say if this has been straightforward for them? Any pitfalls or tips with project setup? Thanks!
    r
    j
    l
    • 4
    • 11
  • t

    Tommy Dwi

    07/07/2022, 4:32 PM
    Halo guys any have experience kmm on iOS ?
  • t

    Tommy Dwi

    07/07/2022, 4:33 PM
    Could you share the experienced?
    l
    r
    d
    • 4
    • 22
  • r

    ribesg

    07/12/2022, 8:51 AM
    I'm trying to understand how the cocoapods plugin works to work around this issue https://youtrack.jetbrains.com/issue/KT-53127/Breaking-change-in-Cocoapods-plugin-between-Kotlin-1621-and-170 Does anyone know why it tries to build a project with the latest versions of the dependencies you specify instead of the right version? I have this in my Gradle build file:
    pod("MaterialComponents/TextFields", "~> 123")
    The generated Podfile in build/cocoapods/synthetic/IOS contains this:
    pod 'MaterialComponents/TextFields'
    Then obviously the Podfile.lock contains:
    - MaterialComponents/TextFields (124.2.0)
    And the build fails, potentially because this version is broken. Is it a bug? I tried with Kotlin 1.6 and 1.7 and it does not seem different
    👀 1
  • j

    Josh Cockrell

    07/12/2022, 5:51 PM
    Anyone have advice for kmm interop with Swift? Specifically how Kotlin
    Bool
    Int
    and
    Double
    become
    KotlinBool
    Int32
    and
    KotlinDouble
    n
    • 2
    • 6
  • s

    Slackbot

    07/14/2022, 3:15 AM
    This message was deleted.
  • d

    darkmoon_uk

    07/14/2022, 7:19 AM
    It looks like CocoaPods integration is broken in (at least)
    1.6.21
    and
    1.7.10
    in case you want to *depend on a Pod that requires the most recent iOS versions (15.4/15.5)*; filed a bug here: 🐛 KT-53174 CocoaPods: Synthetic Podfile does not specify deployment target
    r
    • 2
    • 1
  • m

    MarkRS

    07/14/2022, 8:26 AM
    Looking in the CocoaPods plugin ("open class CocoaPodsExtension") its copyright date is 2010-2019 ! Does this mean I'm picking up an old version??? If so, how? Why?
    d
    • 2
    • 7
  • l

    Landry Norris

    07/14/2022, 6:07 PM
    Where would I find information on this plugin: id(“org.jetbrains.gradle.apple.applePlugin”)? I don’t see a GitHub repo for it. Is this plugin specific to AppCode? Is it released or in an experimental stage? I saw some info here but that’s all I could find.
    d
    • 2
    • 5
  • u

    ursus

    07/14/2022, 8:31 PM
    Any AppCode users here? How can I update swift version? I found the project settings but its seems to do nothing?
  • d

    darkmoon_uk

    07/19/2022, 11:25 PM
    When using the Apple Gradle DSL plugin
    org.jetbrains.gradle.apple.applePlugin
    , does anyone know how control which destination(s) are being built for? I can query
    destinations
    in the DSL which tells me Device and Simulator. I need to restrict it to only Device as I have a Project dependency which won't build for Sim. When using
    xcodebuild
    this is the
    -destination
    switch... I guess if I can find the source to the Apple plugin I could find if that switch is ever applied and trace it back...
  • d

    Daniel Hill

    07/22/2022, 1:26 AM
    I'm trying to set UIView's accessibilityIdentifier property, but it's not recognized by the Kotlin native compiler for either example 1 or 2 below. Any help in how I might set the accessibilityIdentifier property via Kotlin would help me greatly. I'm happy to add custom OBJ-C bindings, but I would appreciate help being pointed to a tutorial to learn how to do so. Any help would be very appreciated. Example 1:
    class MyView: UIView {
        override init(frame: CGRect) {
            super.init(frame: frame)
            self.accessibilityIdentifier = "my-custom-view"
        }
    }
    Example 2:
    val view: UILabel = ...
    view.accessibilityIdentifier = "my-custom-view"
    l
    • 2
    • 2
  • p

    Pat Teruel

    07/27/2022, 8:24 PM
    I’m curious. Anyone who ever asked or tried to add some sort of curl logger for Ktor in iOS Native? Thanks.
    t
    • 2
    • 1
  • t

    Trevor Stone

    07/28/2022, 11:57 PM
    Has anyone successfully gotten the gradle based iOS projects via
    org.jetbrains.gradle.apple.applePlugin
    working, and maybe more specifically on an m1 device?
    • 1
    • 2
  • x

    xxfast

    08/04/2022, 1:26 AM
    Has anyone figured out a nice way to bridge a
    State
    from
    StateFlow<State>
    to SwiftUi as
    @ObservedObject
    ? Rather than doing
    @Published var state: State = State.companion.DEFAULT
    
    viewModel.onState { (state) in
      self.state = state
    }
    h
    j
    +2
    • 5
    • 25
  • b

    brabo-hi

    08/05/2022, 7:04 PM
    Hello guys, i am calling suspend function on ios, and is getting the following error,
    *Calling Kotlin suspend functions from Swift/Objective-C is currently supported only on main thread*
    any clue
    k
    • 2
    • 3
Powered by Linen
Title
b

brabo-hi

08/05/2022, 7:04 PM
Hello guys, i am calling suspend function on ios, and is getting the following error,
*Calling Kotlin suspend functions from Swift/Objective-C is currently supported only on main thread*
any clue
k

kpgalligan

08/06/2022, 3:33 PM
You’re not calling them from the main thread?
We tend to use libraries to better manage the reactive interface. I would check out https://github.com/rickclephas/KMP-NativeCoroutines
b

brabo-hi

08/06/2022, 4:26 PM
Thanks @kpgalligan
View count: 10