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

    rohith

    02/03/2022, 6:51 PM
    Hi 👋 I’m looking to use BitSet (kotlin.native.BitSet) in my common code. However, Android Studio doesn’t seem to find that package. I was under the impression that it’s included in the stdlib. Do I need to include that dependency explicitly?
    m
    • 2
    • 3
  • j

    Jeanne De ArcRuler

    02/04/2022, 1:16 AM
    how do I give bluetooth access for MacOS version of desktop compose? is there any recommended libraries for this
    l
    • 2
    • 7
  • d

    dimsuz

    02/04/2022, 1:59 PM
    We have a sealed class hierarchy:
    sealed class Product { // OK
       sealed class Card : Product() { // OK
         data class CreditCard(...): Card() // Inacessible from swift
      }
    }
    The problem is that
    CreditCard
    is not visible from Swift code, while its parents are visible. Is this a known problem? Are there any workarounds?
    r
    g
    • 3
    • 6
  • f

    Felipe Sáez

    02/04/2022, 2:49 PM
    Hello everyone, I hope you are all doing great. I’m currently trying to get an existing iOS/tvOS framework to consume a new KMM framework. When a new Kotlin Multi Platform Project (KMM) is created from Android Studio, the wizard gives you the option to choose between CocoaPods or XCFramework integrations (see image). 1. When using CocoaPods a new task named
    podspec
    is created which generates a
    podpsec
    file which points to a
    .framework
    file located in
    build/cocoapods/framework/shared.framework
    . Even though it’s mentioned there that an XCFramework is built, I don’t know what gradle task we are supposed to run. When running
    ./gradlew tasks --all
    I don’t see any XCFramework related task. So here some questions about the CocoaPods integration: a. What’s the right way to get a framework that can be used for production considering that I won’t release an app but a framework and that I want to include multiple architecture slices (iOS simulator, iOS device, tvOS simulator, tvOS device)? b. Is it possible to get an XCFramework only using the CocoaPods integration? 2. On the other hand, when choosing XCFramework from the wizard only
    Debug
    and
    Release
    build types/configurations are available and there doesn’t seem to be an option to add more. Here some questions regarding the XCFramework integration: a. What’s the right way to work for development? Do we need to generate a new XCFramework every time we make a change? b. If the existing framework does not exclude i386 architecture, I will get an error regarding this missing architecture. Does KMM not support i386? The existing framework supports iOS 9 which apparently seems to force the i386 architecture. The architectures property in build settings is set to standard (ARCHS = “$(ARCHS_STANDARD)“). Maybe the right setup should combine both? If so what would be the right way to do this? I’ve tried quite a few different approaches and the best I’ve found so far is to use the
    org.jetbrains.kotlin.gradle.plugin.mpp.apple.XCFramework
    function/initializer which doesn’t allow me to use custom build configurations (Test, Preprod). Neither does the
    XCFrameworkConfig
    class. I hope I’m being clear and I hope to be asking the right questions. Have a great weekend. Cheers
    v
    • 2
    • 7
  • g

    grahamborland

    02/04/2022, 5:32 PM
    When I build an MPP project for JS browser(IR) target, the Webpack task copies the
    .js
    and
    .js.map
    files to the distribution directory, but not the
    .d.ts
    file. Is there a way to get that file included too?
    b
    • 2
    • 10
  • m

    Matthew Kruk

    02/04/2022, 5:50 PM
    Trying to figure out kmm library structure when publishing iOS library on cocoapods. I have setup a cocoapod to import the shared code into the ios module and all is good. The podspec is in the shared module. Do I need to add an additional podspec for distribution of the ios module? If so, would I use the root project as the source?
    v
    • 2
    • 1
  • j

    Justin Xu

    02/05/2022, 2:02 AM
    Hi everyone, I’m getting started with KMM with cocoapods as outlined in the documentation on the website, but I keep running into this error:
    'pod install' command failed with an exception:
    Cannot run program "pod" (in directory "...../iosApp"): error=2, No such file or directory
    I installed cocoapods using ruby2.7.5, and I am on M1 mac, following the troubleshooting guide here. My “pod install” command also works in the folder, I am just not sure why this error keeps showing up.
    e
    • 2
    • 2
  • g

    Gillian Buijs

    02/05/2022, 12:52 PM
    is there a way to make all the dependencies in commonMain/androidMain transitive so that they'll be added to the generated .aar file?
    s
    • 2
    • 4
  • t

    theapache64

    02/05/2022, 3:32 PM
    How do i create a multiplatform compose UI library ? I want to create a Compose UI lib that would be used in android and desktop apps. Can anyone point me to the right doc?
    c
    k
    • 3
    • 6
  • p

    Peter Hsu

    02/06/2022, 6:30 AM
    I can't seem to get Android Studio to play nice with KMM on Bumblebee or Bumblebee Patch 1, with Kotlin Multiplatform Mobile plugin installed
    m
    • 2
    • 6
  • k

    khairil.ushan

    02/06/2022, 9:23 AM
    I am trying to play along with KMM on Android Studio, after creating a brand new project with the KMM plugin wizard on my Android Studio, I can run the app to Android Emulator just fine. But when I tried to run it on iOS simulator, I got this error
    Task 'embedAndSignAppleFrameworkForXcode' not found in project ':shared'.
    I am working with M1 Pro machine. After google a little bit, Seems like I have to run the Xcode using Rosetta and update the Build Setting of the iOS project to exclude
    arm64
    then I can run the iOS app via Xcode. But I still can't run it using Android Studio due to the same error. So, is that the only workaround to be able to developing KMM app using M1 ? And, when I got Xcode build successfully, why AS still fail to build/run the iOS App? Thanks everyone, and sorry if this is repeated questions. Feel free to refer me to some previous discussion around this.
    m
    • 2
    • 9
  • e

    eygraber

    02/07/2022, 6:50 AM
    Is there supposed to be support for KMP in Android Studio? I'm on Chipmunk Beta 1, and for kotlin files in a KMP module I get no code completion, and everything is red (but it compiles).
    a
    • 2
    • 2
  • g

    gpaligot

    02/07/2022, 1:44 PM
    Hi here, I have a strange behavior with a model shared with an Android and iOS application. My model is:
    data class AgendaUi(val talks: Map<String, List<TalkItemUi>>)
    And I have a fake data in Kotlin too:
    val fakeAgendaUi = AgendaUi(
        talks = mapOf(
            "10:00" to arrayListOf(fakeTalkItem, fakeTalkItem),
            "11:00" to arrayListOf(fakeTalkItem, fakeTalkItem),
            "12:00" to arrayListOf(fakeTalkItem, fakeTalkItem),
        ),
    )
    The usage of this fake data work fine on Android but when I use this fake data instance on iOS, I receive a Dictionary with the good key and a list of two
    NSNull
    elements. But if I create the fake data in Swift, everything work fine:
    let agenda = AgendaUi(
        talks: [
            "10:00": [TalkItemUiKt.fakeTalkItem, TalkItemUiKt.fakeTalkItem],
            "11:00": [TalkItemUiKt.fakeTalkItem, TalkItemUiKt.fakeTalkItem],
            "12:00": [TalkItemUiKt.fakeTalkItem, TalkItemUiKt.fakeTalkItem],
            "13:00": [TalkItemUiKt.fakeTalkItem, TalkItemUiKt.fakeTalkItem],
        ]
    )
    Somebody know why? A bug in interoperability maybe?
    m
    • 2
    • 3
  • m

    Michael Paus

    02/07/2022, 4:33 PM
    When you create a Kotlin multiplatform project and only configure a JVM target for it then you can happily use any Java class directly inside the commonMain source set. IntelliJ even gives you code completion hints and everything. Doesn’t this completely undermine the whole purpose of splitting things up into common and non-common parts? I could add more targets later and then my common part would be broken.
    👍 2
    l
    s
    • 3
    • 6
  • a

    Alen Kirm

    02/07/2022, 4:56 PM
    Hi. For everyone using KMM with Ktor and Coroutines dependency, which versions of these two are you using? 🙏 So far, I was only able make it work with
    Ktor 1.6.7
    and
    Coroutines 1.5.1-new-mm-dev2
    but
    ./gradlew <module>:compileKotlinMetadata
    gradle tasks are failing.
    m
    h
    +2
    • 5
    • 18
  • i

    Igor Milakovic

    02/07/2022, 7:07 PM
    Is it possible to make all the classes from the
    shared
    module
    internal
    by default? I would like to expose use case interfaces only to my
    iosApp
    and
    androidApp
    , as they have no business instantiating anything else from the shared module.
    🇳🇴 1
    :thank-you: 1
    e
    j
    • 3
    • 4
  • t

    Tony Kazanjian

    02/07/2022, 10:28 PM
    Hey KMP people! Just have a question I'd like to ask the community about what it was like getting started writing Kotlin Multiplatform apps from a primarily Kotlin and/or Android background. What were the gotchas, pain points, or assumptions you had to overcome when you first got started?
    l
    r
    +2
    • 5
    • 8
  • a

    Arkadii Ivanov

    02/08/2022, 11:26 AM
    I'm unable to build an Xcode project on macOS M1. The error is:
    Task 'embedAndSignAppleFrameworkForXcode' not found in project '😒ample:todo-darwin-umbrella'.
    I already checked KT-49637 and KT-47077 which look similar to my problem, but nothing was helpful. I'm using Kotlin 1.6.10 and I have
    iosSimulatorArm64
    target configured. I have the following Java version installed locally:
    15.0.6 (arm64) "Azul Systems, Inc." - "Zulu 15.38.17"
    Also I noticed that there are Gradle tasks
    linkDebugFrameworkIosArm64
    and
    linkDebugFrameworkIosX64
    , but there is no Gradle task like
    linkDebugFrameworkIosSimulatorArm64
    , only
    linkDebugTestIosSimulatorArm64
    which seems irrelevant. Running the Xcode in Rosetta mode fixes the build, but I would like avoid Rosetta if possible. Are there any ideas of how I could fix the issue?
    a
    j
    +2
    • 5
    • 11
  • g

    georgi

    02/08/2022, 3:32 PM
    I've already seen a few posts about multi-module KMM setups, and even asked a question on the topic myself, so I thought I'd share this short article I found. Helped me to understand what's going and offers one possible solution to the problem.
    y
    • 2
    • 2
  • s

    Stylianos Gakis

    02/08/2022, 4:28 PM
    Is there a KMP option to deal with raw Json objects? Like JSONObject from android? I am aware of kotlinx.serialization but I am interested in constructing arbitrary untyped Json objects and adding arrays/values inside it instead of mapping from/to Kotlin classes
    j
    • 2
    • 6
  • v

    Vivek Modi

    02/08/2022, 5:41 PM
    Hey Everyone, I’m in the early stages of exploring Multiplatform in personal project. I wrote an  expect/actual function to retrieve user input and it seemed neat. Then I wrote another function and refactored a few things and the expect/actuals broke. I still don’t quite know why, but in digging around looking for more information about expect/actual I realized that maybe interfaces would be a better way to go. So the question is: since we already have interfaces, what is the actual benefit of using expect/actual, or what is a situation where it is better or even necessary when compared to using an interface?
    b
    • 2
    • 4
  • e

    electrolobzik

    02/08/2022, 5:54 PM
    Hey guys, is it possible to use Compose for Web and have Ktor based backend on the same Netty web server instance? If I follow
    <https://play.kotlinlang.org/hands-on/Full%20Stack%20Web%20App%20with%20Kotlin%20Multiplatform>
    I get this error: 
    The Compose Compiler requires the Compose Runtime to be on the class path, but none could be found
     while compiling jvm target. I have compose dependencies specified only for js target, but it looks like the Compose Plugin is used for jvm and it causes the error. How could I fix that? Are there any sample projects with Compose and Ktor backend working together?
    b
    • 2
    • 3
  • l

    Lukasz Burcon

    02/08/2022, 6:14 PM
    Hey, have any of you had a problem with KaMPKit not being able to index androidMain? I Can’t find usages of any class/import, and even expect/actual doesn’t seem to be working. On the other hand, iosMain work as expected
    • 1
    • 1
  • e

    electrolobzik

    02/08/2022, 6:44 PM
    How should I correctly replace
    application {
        mainClass.set("com.example.ApplicationKt")
    }
    for jvm target when I use multiplatform setup? I get this error:
    Error running 'ApplicationKt': Class 'com.example.ApplicationKt' not found in module 'com.example.main'
    b
    h
    • 3
    • 3
  • x

    xxfast

    02/08/2022, 10:27 PM
    Hi all. This might be more of a #gradle question than #multiplatform, but I have this task that generate api & models in my
    commonMain
    openApiGenerate {
      generatorName.set("kotlin")
      library.set("multiplatform")
      ...
    }
    By default this task doesn’t
    dependOn
    to run before any build task, so I had to manually do so
    tasks.preBuild { dependsOn(tasks.openApiGenerate) }
    This works for
    android
    , but for desktop i had to do
    tasks.named("compileKotlinDesktop") { dependsOn(tasks.openApiGenerate) }
    so forth for all other targets. Is there a common task that I can hook on to instead?
    e
    • 2
    • 11
  • k

    kierans777

    02/09/2022, 1:42 AM
    I'm trying to write a library that can be used on the JVM and iOS. However my tests (written in Kotest) are failing the iOS linking step.
    > Task :my-library:linkDebugTestIosX64 FAILED
    e: Could not find "io.kotest:kotest-assertions-api" in [ 
      /Users/kieran/Projects/my-library/kotlin, 
      /Users/kieran/.konan/klib, 
      /Users/kieran/.konan/kotlin-native-prebuilt-macos-x86_64-1.6.0/klib/common, 
      /Users/kieran/.konan/kotlin-native-prebuilt-macos-x86_64-1.6.0/klib/platform/ios_x64
    ]
    FAILURE: Build failed with an exception.
    // arrowVersion = 1.0.1
    commonMain {
        dependencies {
            api "io.arrow-kt:arrow-core:${rootProject.ext.arrowVersion}"
            api "io.arrow-kt:arrow-fx-coroutines:${rootProject.ext.arrowVersion}"
        }
    }
    
    // kotestVersion = "5.1.0"
    commonTest {
        dependencies {
            implementation "io.kotest:kotest-framework-engine:${rootProject.ext.kotestVersion}"
            implementation "io.kotest:kotest-assertions-core:${rootProject.ext.kotestVersion}"
            implementation "io.kotest:kotest-property:${rootProject.ext.kotestVersion}"
            implementation "io.kotest.extensions:kotest-assertions-arrow:1.2.2"
        }
    }
    If I look on my disk the files are present (the
    .a
    files are present, I've reduced the amount of output)
    $ find ~/.konan/ -name '*assertions-api*'
    /Users/kieran/.konan/kotlin-native-prebuilt-macos-x86_64-1.6.0/klib/cache/ios_x64-gSTATIC/kotest-assertions-api-iosx64
    
    $ find ~/.konan/ -name '*arrow*'
    /Users/kieran/.konan/kotlin-native-prebuilt-macos-x86_64-1.6.0/klib/cache/ios_x64-gSTATIC/kotest-assertions-arrow-iosx64
    /Users/kieran/.konan/kotlin-native-prebuilt-macos-x86_64-1.6.0/klib/cache/ios_x64-gSTATIC/arrow-core-iosx64
    So the main linking step can find Arrow, but the test linking can't find the
    kotest-assertions-api
    . Has anyone else had this sort of problem?
    a
    • 2
    • 3
  • j

    julien hamon

    02/09/2022, 5:04 AM
    Hi all, i contact you because i try to integrate an iOS native librairie inside a KMP projet. i use cocoapods to manage the dependencies. it works until i tried to import the library i don’t find the object. if u can help to find why ? and if it’s the best way. Thanks 🙂 A context to understand the structure Swift UI / Jet Pack compose -> KMP shared code (store/usecase) -> API (expect/actual) to use the native part. some code : build.gradle
    iosTarget("ios") { }
    cocoapods {
            summary = "Some description for the Shared Module"
            homepage = "Link to the Shared Module homepage"
            ios.deploymentTarget = "14.1"
            frameworkName = "shared"
            podfile = project.file("../iosApp/Podfile")
            framework {
                isStatic = false
                transitiveExport = true
            }
            pod ("AlgoliaSearchClient")
    
        }
    actual in iOS main:
    import cocoapods.AlgoliaSearchClient.*
    
    actual interface SearchApi {
    
        actual fun search(words: String): List<Training> {
            val search = ClientSearch()
            return listOf(Training(id = "1", name = "name1"), Training(id = "2", name = "name2"))
        }
    }
    v
    • 2
    • 3
  • v

    vincentm

    02/09/2022, 9:33 AM
    Hi Folks, I’m facing an issue with my KMP dependencies on my Android/JVM project while i’m testing, there is my trouble:
    androidTest {
        dependsOn(commonTest)
        dependencies {
            implementation("io.mockk:mockk:$mockkVersion") // <-- this dependency is also added to the `androidAndroidTest` source set
        }
    }
    androidAndroidTest {
        dependsOn(commonTest)
        dependencies {
            implementation("io.mockk:mockk-android:$mockkVersion")
        }
    }
    For an unknown reason, my dep
    io.mockk:mockk
    is also added to the
    androidAndroidTest
    source set.
    :thread-please: 2
    ✅ 1
    • 1
    • 5
  • e

    electrolobzik

    02/09/2022, 12:16 PM
    How should I correctly specify resources folder for jvm module in multiplatform project? Now I use configuration like this:
    kotlin {
        jvm {
            withJava()
        }
        sourceSets {
            val jvmMain by getting {
                dependencies {
                ...
                }
            }
        }
    }
    and don’t see resource files from
    src/jvmMain/resources
    in class path after project was built. What I am doing wrong and how could I get resources in my class path? P.S. I see resources in the
    processedResources
    folder, so they are processed somehow. But for some reason not put in the result folder (
    classes/kotlin/jvm/main/META-INF
    )
    s
    • 2
    • 5
  • s

    Siggi Gunnarss

    02/09/2022, 3:58 PM
    Today we have an Android/Ios library that we deliver to our ios project via cocoapods. It's pretty easy to switch between using a published cocoapod and local development (using podspec build phases). Iteration times are slow though. Using something like
    embedAndSignAppleFrameworkForXcode
    speeds things up but that doesn't work with making ios archives (?). Has anyone here included
    embedAndSignAppleFrameworkForXcode
    in a development proces where it's easy to switch between compiling kotlin locally and using some precompiled artifact (XCFramework, cocoapod)?
    v
    s
    • 3
    • 5
Powered by Linen
Title
s

Siggi Gunnarss

02/09/2022, 3:58 PM
Today we have an Android/Ios library that we deliver to our ios project via cocoapods. It's pretty easy to switch between using a published cocoapod and local development (using podspec build phases). Iteration times are slow though. Using something like
embedAndSignAppleFrameworkForXcode
speeds things up but that doesn't work with making ios archives (?). Has anyone here included
embedAndSignAppleFrameworkForXcode
in a development proces where it's easy to switch between compiling kotlin locally and using some precompiled artifact (XCFramework, cocoapod)?
v

Viacheslav Kormushkin

02/09/2022, 4:20 PM
Hi Siggi, Could you please elaborate on
embedAndSignAppleFrameworkForXcode
not working with iOS archives? Do you mean there are some problems with archiving iOS app for distribution?
s

Sam

02/10/2022, 3:12 AM
It works fine for me when making archives. The code completion has stopped working for some reason but everything else is fine.
👍 1
s

Siggi Gunnarss

02/10/2022, 10:02 AM
Encouraging to hear Sam. Code completion fails sometimes for us as well, might be unrelated. So that wouldn't be a deal breaker for us . Yes Viacheslav embedandsign is not working for us with archives, I just get a Swift compiler error "No such module ". After looking at the source code for the plugin I assumed it was expected to only work with debug builds and other solutions were required for release builds (assembleXCFramework + some build logic) Good to hear that it's supposed to work with archives/releases. I was mostly using: https://blog.jetbrains.com/kotlin/2021/07/multiplatform-gradle-plugin-improved-for-connecting-kmm-modules/ and the linked project. Is there any other documentation I should look at to narrow down our problem?
v

Viacheslav Kormushkin

02/10/2022, 12:47 PM
I can not say for sure why it does not work in your setup. But my guess is that you use custom Xcode configurations for archiving. If this is true, you should add KOTLIN_FRAMEWORK_BUILD_TYPE variable to your Xcode build settings and set it to release or debug for each of your custom xcode configurations. Here is an example If this does not resolve your issue please submit a ticket to Youtrack and provide a minimal reproducer if possible.
s

Siggi Gunnarss

02/10/2022, 5:34 PM
Thanks for that. No custom configuration, just Debug and Release. Not sure why, but it seems to be working now 👍 ...except for some new signing issue. The signing issue is not present on my minimal reproducer so hopefully something we can figure out.
View count: 8