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

    Nikolay Kasyanov

    04/09/2020, 1:54 PM
    👋 I’m trying to access
    NSBundle.mainBundle.infoDictionary!!
    values with using CoreFoundation constants like
    kCFBundleVersionKey
    but always getting
    null
    . If I use respective literal strings (like
    "CFBundleVersion"
    ) it works like a charm. What am I missing here? The constants are
    CFStringRef
    , could it be the issue?
    b
    2 replies · 2 participants
  • d

    David Winer [G]

    04/23/2020, 5:47 PM
    Hey everyone, the Google team is doing an exploratory UX research study on Kotlin multiplatform and the developer workflows involved. We'd love to recruit some volunteers from this group — please fill out this form if you're interested!
    👌 1
    l
    1 reply · 2 participants
  • p

    phldavies

    04/27/2020, 1:32 PM
    is there any way to call
    NSData(base64Encoded:String)
    from kotlin?
    1 reply · 1 participant
  • d

    David Winer [G]

    04/27/2020, 4:51 PM
    Friendly reminder — if you do Kotlin multiplatform development, the Google team would love to speak with you! Link to sign up here.
    r
    3 replies · 2 participants
  • n

    Nikolay Kasyanov

    05/15/2020, 1:35 PM
    Hey folks, we started getting a crash in
    (anonymous namespace)::garbageCollect(MemoryState*, bool)
    after releasing a version of an iOS app with a fairly big chunk of new Kotlin/Native code. There’s a somewhat similar thread but our stack trace is different.
    s
    5 replies · 2 participants
  • r

    Rainer Schlonvoigt

    05/18/2020, 8:51 AM
    Does somebody know why these lines crash in Xcode 11.4.1?
    let thisIsAKotlinInt: Any = KotlinInt(int: 3)
    XCTAssertEqual(thisIsAKotlinInt as? KotlinInt, KotlinInt(int: 3))
    n
    6 replies · 2 participants
  • k

    katokay

    05/27/2020, 7:25 PM
    I recently put together a sample that demonstrates a redux-like store using kotlin flows in a multi-platform project and rendering to SwiftUI views in a unidirectional data flow. It seems to be working great with one exception. State is updated as the flow collects / iterates but the UI never repaints until the flow completes. I'm suspecting it's in the single threaded nature of coroutines on iOS and that I need a newer build of coroutines native-mt. I'm making some assumptions there though. Curious if anyone has any ideas? Here is the project. https://github.com/CoreyKaylor/kotlin-mpp-flow-store
    r
    4 replies · 2 participants
  • p

    phldavies

    05/29/2020, 12:19 PM
    Sharing this here in case anyone can provide some input?
    k
    2 replies · 2 participants
  • p

    phldavies

    06/08/2020, 8:46 AM
    What’s the correct/safe way to get a
    CFStringRef
    (like the
    kCFBundleNameKey
    constant) as a Kotlin
    String
    ?
    n
    6 replies · 2 participants
  • d

    Derek Ellis

    06/12/2020, 12:36 AM
    Does the cocoapods plugin support pods with dashes in their name? e.g. Mapbox-iOS-SDK I get this error when I try to build from XCode:
    > Task :shared:cinteropMapbox-iOS-SDKIos
    Exception in thread "main" java.lang.Error: /var/folders/9c/t4r21hhn7y5fflv2v71n4zmr0000gn/T/tmp5889693057335845972.m:1:15: error: expected ';' after module name
    a
    1 reply · 2 participants
  • t

    Theo

    06/12/2020, 2:11 PM
    I don't know if this has been asked or not regarding multiplatform, I also saw theres one question on stack overflow about it but no answer. Prior to XCode 11.4, Xcode was able to detect whether or not it needed to build the shared framework for
    arm
    or
    x86
    however since the upgrade it no longer can do this. My work around since then has just been to run a shell command that builds the framework for which architecture I want when switching between device and simulator. Anyone have any pointers? is this a known issue?
    s
    2 replies · 2 participants
  • d

    Derek Ellis

    06/14/2020, 10:07 PM
    I'm trying to create a Kotlin subclass of
    MGLShapeSource
    from the Mapbox SDK.
    MGLShapeSource
    is a subclass of
    MGLSource
    which has an initializer called
    initWithIdentifier
    . When I try to create an instance of my Kotlin subclass, I get an exception thrown saying
    initWithIdentifier: is not implemented in Shared....KotlinSubclass0
    which seems to be the initializer from
    MGLSource
    so I created another constructor in my subclass to override that initializer but now I get a
    EXC_BAD_ACCESS
    when that initializer is called. Maybe this is just because I'm not quite as familiar with how Obj-C handles initialization, but I'm not really sure what's happening here?
    a
    2 replies · 2 participants
  • a

    Alberto

    06/18/2020, 2:51 PM
    Hello, my team is evaluating to use Kotlin Multiplatform for our Android and iOS apps. One concern I have is in regards the ability to link against multiple Kotlin Multiplatform libraries in the future. I saw there is a limitation on iOS specifically looks like: https://github.com/JetBrains/kotlin-native/issues/2423 it appears that it may have been fixed on a more recent version of Kotlin 1.3.70, could anyone please confirm?
    b
    8 replies · 2 participants
  • a

    Alberto

    06/23/2020, 2:19 PM
    When building against multiple KMP libraries on iOS, does the final application size increase linearly? I've seen the minimum .framework target I can generate for iOS is around ~2MB. If building against N KMP libraries does the iOS application binary end up being N * ~2MB larger? If so, that would be a concern in using multiple KMP libraries on iOS, would it be possible to do any optimizations, perhaps combining into a single .framework?
    s
    1 reply · 2 participants
  • v

    Viresh

    06/24/2020, 10:58 AM
    Hello, I am bit new to Kotlin multi platform and trying to create a multi platform module to be used in our iOS and android apps. I have few questions if somebody can provide me more info or redirect me to correct documentation: 1. How can I specify minimum iOS version & target iOS version for iOS frameworks rather than going with default one? 2. Is there any limitation on what Apple's iOS native framework we can use from Kotlin module? I was trying to import 
    Combine
     framework but was not able to do.
    s
    1 reply · 2 participants
  • a

    Alberto

    06/25/2020, 9:23 PM
    Does anyone have any suggestions on how to go about creating a single .framework from a bunch of different .klib files?
    r
    13 replies · 2 participants
  • t

    Theo

    06/27/2020, 8:28 PM
    do I need to use the cocoapods plugin to access a third party iOS library in order to wrap it? is there a way without cocoapods?
    k
    1 reply · 2 participants
  • n

    Nikolay Kasyanov

    07/06/2020, 12:35 PM
    hey folks, is there a way to set a custom Obj-C/Swift name to a class/interface in Kotlin code?
    s
    2 replies · 2 participants
  • a

    Andrea Prearo

    07/07/2020, 5:24 PM
    I’m trying to build an umbrella framework that bundles two subprojects. Here’s my project structure:
    |- shared-libraries
     \- network
      |- network-core
      |  |- src
      |  |  \- commonMain
      |  \- build.gradle.kts
      |
      |- network-ktor
      |  |- src
      |  |   \- commonMain
      |  \- build.gradle.kts
      |
       \- build.gradle.kts
    The
    network
    module build script has the following dependencies: •
    api(project(":shared-libraries:network:network-core"))
    •
    api(project(":shared-libraries:network:network-ktor"))
    Basically,
    network
    is an umbrella module that contains no source code. For Android, all works fine. I’m able to import
    :shared-libraries:network
    without issues. For iOS, I’m leveraging
    FatFrameworkTask
    (registered as
    fatFramework
    ) to build the umbrella framework. When I run
    ./gradlew :shared-libraries:network:fatFramework
    , Gradle compiles the code but it doesn’t create any iOS framework. I’m not sure why. Is there a better/easier way to create an iOS umbrella framework for a project structure like the one above?
    r
    s
    16 replies · 3 participants
  • n

    Nikolay Kasyanov

    07/10/2020, 10:32 AM
    folks, I’m getting build error in the
    compileIosMainKotlinMetadata
    task. Basically a bunch of
    unresolved reference
    errors as if I were importing something that doesn’t exist (even though it’s there and
    compileKotlinIos<platform>
    works flawlessly). Any ideas what might be causing this?
    3 replies · 1 participant
  • a

    Alberto

    07/13/2020, 7:38 PM
    Getting "Unresolved reference: Class" when building the "compileKotlinIos" step - it seems the "Class" is not resolved for iOS build step, does it need a separate dependency? Code: "operator fun <T : Any> get(apiInterface: Class<T>): LazyComponent<T>" - works fine on a non KMP build.
    r
    9 replies · 2 participants
  • r

    Rainer Schlonvoigt

    07/14/2020, 8:21 AM
    and i can drag and drop that framework into an iOS demo app, but when using the package manager, it can’t find the module when trying to import
    w
    j
    4 replies · 3 participants
  • w

    willyrs

    07/15/2020, 10:24 AM
    Can one create a framework for mac catalyst? I’ve built the target:
    macosX64("mac") {
        binaries {
            framework("mac")
        }
    }
    but when I try to import the framework it says:
    /Users/*/Projects/RTE/apod-kampkit/ios/ApodKMP.xcodeproj Building for Mac Catalyst, but the linked and embedded framework 'mac.framework' was built for macOS. You may need to restrict the platforms for which this framework should be linked and embedded in the target editor, or replace it with an XCFramework that supports both platforms.
    I’m a bit confused since it clearly says that the framework is (correctly?) built for macOS. I’ve also tried to put this framework in a normal macOS app project and it works
    🇳🇴 1
    t
    1 reply · 2 participants
  • p

    phldavies

    07/20/2020, 10:42 AM
    I’m getting
    Undefined symbols for architecture arm64
    (and x86_64) when attempting to build my project in xcode that depends on
    TensorFlowLiteObjC
    pod, which itself depends on
    TensorFlowLiteC
    which is a binary framework, The classes being referred to in the error are part of the
    ObjC
    wrapper framework which is provided as source. Is there any where I can look to help resolve this? I’ve done a clean
    pod install
    and cleaned the xcode build directory but I’m still hitting the same issue (for both a real device and for simulator)
    s
    2 replies · 2 participants
  • f

    Foso

    08/01/2020, 7:30 PM
    At KotlinConf 2019 Andrey Breslav said, that in 2020 a Android Studio Plugin to debug Kotlin iOS Apps will be released, does anybody know when this will be released?
    d
    1 reply · 2 participants
  • t

    Theo

    08/21/2020, 12:14 PM
    Does anyone have experience setting up something like Sentry or Bugsnag with a KMP project on iOS? do I need to do something special to get proper stack traces?
    👀 1
    s
    2 replies · 2 participants
  • t

    Tijl

    08/21/2020, 12:16 PM
    Is there any serious plan to make AppCode have decent Kotlin/Native debugging? I just tried 2020.2 with the 1.4.0-release-AppCode-202.6397.122-7 kotlin/native plugin with a fresh “Single View app with a Kotlin/Native framework” template. It still does not support the variable view (though rather than hang, it at least says “not available”).
    d
    7 replies · 2 participants
  • a

    Alberto

    08/28/2020, 7:04 PM
    Hello, it looks like KMP produces different binaries per each iOS architecture. Right now our iOS team has to switch between x86 and arm64 depending on the targets and having some problems detecting the correct one. I saw this thread https://github.com/JetBrains/kotlin-native/issues/2574 about a universal binary generator using lipo. I just wanted to know if anyone else had found alternatives or if that's the way to go, thanks!
    b
    2 replies · 2 participants
  • d

    dazza5000

    08/31/2020, 3:00 PM
    I am trying to use
    WKScriptMessageHandlerProtocol
    which has one abstract function defined, but when building the project it wants me to implement all of the members for NSObject? Does anyone know how to fix that?
    r
    n
    7 replies · 3 participants
  • d

    dazza5000

    09/01/2020, 2:46 PM
    my mp project builds successfully, but the imports do not display correctly in intellij - any ideas?
    l
    22 replies · 2 participants
Powered by Linen
Title
d

dazza5000

09/01/2020, 2:46 PM
my mp project builds successfully, but the imports do not display correctly in intellij - any ideas?
l

louiscad

09/01/2020, 2:47 PM
Different Kotlin versions between the project and the IDE plugin?
d

dazza5000

09/01/2020, 2:49 PM
let me check
all of my plugins are up to date
l

louiscad

09/01/2020, 2:49 PM
The project
If it's not 1.4.0 but the IDE plugin is 1.4.0, then it's expected.
d

dazza5000

09/01/2020, 2:50 PM
Untitled
l

louiscad

09/01/2020, 2:51 PM
What was different with the last time it was working?
Also, you can confirm you're on a Mac?
d

dazza5000

09/01/2020, 2:51 PM
I'm on mac
it broke when I changed my ios target to this
Untitled
l

louiscad

09/01/2020, 2:52 PM
To this from…?
Did you touch the
gradle.properties
file? Do you have HMPP related flags?
d

dazza5000

09/01/2020, 2:53 PM
it was from the val targetIOS = blah blah that projects used to have
gradle.properties
Untitled
this is what it was previously
Untitled
l

louiscad

09/01/2020, 2:56 PM
You need to enable HMPP: https://kotlinlang.org/docs/reference/mpp-share-on-platforms.html#use-native-libraries-in-the-hierarchical-structure
d

dazza5000

09/01/2020, 2:58 PM
giving it a try - thank you
beautiful
l

louiscad

09/01/2020, 3:01 PM
🙂
View count: 6