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

    Simon BRUNOU

    05/10/2021, 12:25 PM
    Hi all, I’m currently having trouble converting a Kotlin
    Map
    to an objective-c
    CFDictionary
    using
    CFDictionaryCreate
    . The main issue is using the pointers to go back and forth between Kotlin and Objective-C. Here’s my code so far (not generic for now will be later)
    fun Map<CFStringRef?, Any?>.toCFDictionary(): CFDictionaryRef? {
        return CFDictionaryCreate(
            kCFAllocatorDefault,
            keys,
            values,
            size.toLong(),
            kCFTypeDictionaryKeyCallBacks,
            kCFTypeDictionaryValueCallBacks
        )
    }
    There is a type mismatch for the second, third, fifth and sixth arguments. Second and third arguments should be CValuesRef<COpaquePointerVar>? but are currently Set<CPointer<__CFString>?> and Collection<Any?>. The last two arguments should be CValuesRef<CFDictionaryKeyCallBacks>? and CValuesRef<CFDictionaryValueCallBacks>? but are CFDictionaryKeyCallBacks and CFDictionaryValueCallBacks. I do not know how to convert those values to the expected ones, can anyone help me plase ? Thank you for your time.
    s
    r
    6 replies · 3 participants
  • d

    Daniele B

    05/10/2021, 5:05 PM
    is there any meaningful workaround to be able to access shared-code Sealed Classes from Swift?
    m
    2 replies · 2 participants
  • a

    andylamax

    05/11/2021, 8:33 PM
    Hey there, I tried googling without much help, and I figured I should ask here. Is there a way, I can write and compile kotlin multiplatform apps that also targets ios from a linux machine? the reason is I can't afford a mac. or, is there any form of setup I can do on a PC or even install a non official mac os so that I can also build for ios? I know this has so little to do with kotlin, but I am guessing this is where I can get help from. Thanks in advance
    🇳🇴 2
    s
    l
    +1
    8 replies · 4 participants
  • a

    Anthony Pages

    05/31/2021, 8:51 AM
    Hey everyone ! Am I the only one to have collision naming issues when generating obj-c headers ? If I have two interfaces with a same property but of different type, the compiler will add an
    _
    at the end of one of them in the header.
    interface A {
        val foo: Int
    }
    interface B {
        val foo: Int?
    }
    I will have the following header:
    __attribute__((swift_name("A")))
    @protocol A
    @required
    @property (readonly) int32_t foo __attribute__((swift_name("foo"))); // <----- foo: OK
    @end;
    
    __attribute__((swift_name("B")))
    @protocol B
    @required
    @property (readonly) KotlinInt * _Nullable foo_ __attribute__((swift_name("foo_"))); // <----- foo with an underscore: NOK
    @end;
    I didn't find any issue on https://youtrack.jetbrains.com/ So I ask to you here before opening one. _P.S: if props have the same type, there is no collision and no `_`_ added.
    b
    2 replies · 2 participants
  • g

    gbasile

    06/21/2021, 6:08 PM
    Hello community 👋 I was exploring how to work with
    StateFlow
    on the Swift side and I come up with this idea in order to translate the stream into a
    Combine
    Producer. I have the feeling that I’m reinventing the wheel 🤔 Is there any better alternative already available to achieve these adapters seamlessly? https://gist.github.com/gbasile/955b22e7334dc5c5dcbef8ed0e7fccde
    s
    l
    3 replies · 3 participants
  • f

    Fabio Santo

    07/08/2021, 9:15 AM
    Hey everyone👋 is there any iOS developer based in Australia looking for new opportunities here?
    g
    1 reply · 2 participants
  • k

    Kartik Prakash

    08/01/2021, 2:00 AM
    Hi all, I’m new to iOS development and trying out kotlin multiplatform. Does anyone know of a good example or a way for consuming fat xcframework .zip artifact in a native iOS app from a remote location?
    l
    2 replies · 2 participants
  • r

    ribesg

    08/20/2021, 10:11 AM
    So it’s probably a long shot as I sometimes feel like I’m the only one doing UIKit in Kotlin, but does anyone know if there’s a know bug or trick with
    CAGradientLayer
    in Kotlin/Native? I really can’t get it to work even on a simple view and I feel like I checked all the problems people usually encounter when using it in ObjC/Swift
    t
    s
    10 replies · 3 participants
  • n

    nhaarman

    08/26/2021, 9:13 AM
    What tactic should I use for the following scenario? • I have an existing XCode project that uses XCodegen and a Podfile • I created a KMM project with logic I want to share between JVM and iOS What steps should I take to use my logic in my XCode project? Should I create fat frameworks? An XCFramework? Something else?
    l
    s
    +1
    9 replies · 4 participants
  • n

    Nikolay Kasyanov

    08/31/2021, 3:02 PM
    👋 hey folks Has anyone tried to expose an interface with a suspend function and implementing this interface in Swift? Is it even expected to work? I’m trying this rn and if I call
    completionHandler
    not on the same thread the “coroutine” method was called on, I get illegal sharing exception:
    class DependencyImpl: FooBarDependency {
        func getName(completionHandler: @escaping (String?, Error?) -> Void) {
            ...
        }
    }
    When thread stays the same, it’s all good. I’m using coroutines 1.5.1-native-mt. Kotlin code in comments.
    r
    a
    7 replies · 3 participants
  • n

    Nikolay Kasyanov

    09/01/2021, 9:36 AM
    👋 it’s me again how does one use
    XCFramework
    extension function from
    build.gradle
    (no KTS)? Importing
    import org.jetbrains.kotlin.gradle.plugin.mpp.apple.XCFramework
    doesn’t work:
    unable to resolve class org.jetbrains.kotlin.gradle.plugin.mpp.apple.XCFramework
    r
    m
    15 replies · 3 participants
  • n

    Nikolay Kasyanov

    09/06/2021, 11:35 AM
    👋 let’s say I have this:
    public expect class PlatformDecimal
    public expect value class Decimal(public val impl: PlatformDecimal)
    
    // in iosMain:
    @Suppress("CONFLICTING_OVERLOADS")
    public actual typealias PlatformDecimal = NSDecimalNumber
    
    public actual value class Decimal(public val impl: NSDecimalNumber) {
    If I make a framework out of it, all instances of
    Decimal
    have type of
    id
    (I’d expect
    NSDecimalNumber
    there) in the generated Objective-C header. Is this a known limitation?
    1 reply · 1 participant
  • p

    Pat Teruel

    09/16/2021, 12:13 AM
    Anyone who has experienced an issue with Cocoapods? In the attached error, I’m trying to add ‘SQLCipher’, but the same error occurs when I try to sync gradle with Pods like ‘AFNetworking’ or ‘Reachability’, those that are Objective-C pods. This doesn’t occur on my other mac. I’m just wondering if anyone ever experienced this and what steps you did to solve this? Thank you.
    sync-stacktrace.txt
    m
    22 replies · 2 participants
  • p

    pampanet

    09/20/2021, 6:36 PM
    Hi, I would like to know if it’s possible with Kotlin MPP or Kotlin Native, to create an IntentExtension as a kotlin MPP library. I’m stuck with the glue-code actually, because Kotlin allows me to check for SiriKit permissions and add words to an INVocabulary, but it actually fails because of
    Info.plist
    missing entries about NSExtension. Is it possible to create these entries for handling custom Intents with a kotlin project?
    l
    2 replies · 2 participants
  • p

    Pat Teruel

    09/22/2021, 7:43 AM
    This will probably be a bit vague of a question, but it’s related to ktor, and we’re generating an OpenAPI client from a certain source, into KMM code. Not sure if anyone has any sort of experience when it comes to KMM, OpenAPI and iOS. Let’s take this client for example, since I had troubles integrating this from the beginning (I found a workaround back then, but now there’s a major issue with our own client) https://github.com/andrewemery/openapi-generator-kotlin-multiplatform-petstore These errors only occur on Kotlin Native, specifically for iOS. The issues are pretty similar to this: https://youtrack.jetbrains.com/issue/KTOR-1087 Our solution was to wrap it inside an immutable object, and yes, it worked.
    object ClientWrapper{
        val api = PetApi()
    }
    While it did work, now we have some adjustments on our own client. It needs to have a Bearer Token. In order to that, I need to call the
    setBearerToken()
    function inside the
    api
    . But I can’t do that when it’s wrapped in an immutable class. So I had to instantiate the Api object everytime I need to set the bearer token. The thing is, it’s not working at all in iOS. It gives me off an error of “Frozen Mutability Exception”, it’s kind of pointing out on the lazy variables. While I get the gist of the problem, what I’m not sure of is how to do some workarounds to solve this problem. Putting a
    @ThreadLocal
    on the client wrapper itself doesn’t seem to work at all. Has anyone ever solved this? I’m seeing certain youtrack posts that it will not be solved until Kotlin changes some memory stuff, but I’m not sure. I hope someone can help me figure this out. Thank you.
    m
    1 reply · 2 participants
  • b

    Bastian

    09/29/2021, 4:31 PM
    Hi! 👋 I'm creating a wrapper for a multiplatform dependency. Some functions of my wrapper are not available to my iOS app (those that have types in their signatures that were defined by the dependency I'm wrapping). Interestingly, these functions exist in the
    shared.h
    header file though. Do you have any idea how I might be able to make these functions available to my iOS App code?
    ✅ 1
    r
    k
    +1
    9 replies · 4 participants
  • b

    Bastian

    10/05/2021, 12:43 PM
    Hey there! 👋 I'm trying to pack the classes of a
    cinterop multiplatform dependency
    into the
    shared.framework
    for my iOS app (to make them available). The dependency uses
    cinterop
    as it's wrapping a C library. I'm already trying to
    export
    it via the Gradle setup (see setup in the thread). Though when building in either Xcode or AppCode, I get an error about
    missing symbols for architecture x86_64
    and a warning that the
    dependency can't be exported
    (see error log in the thread). I tried fixing this by including the
    .def
    file of the wrapping dependency and the
    include
    folder of the C library itself and making the export
    transitive
    . But this didn't help. I'm using Kotlin 1.5.31.
    ✅ 1
    3 replies · 1 participant
  • f

    Fudge

    10/07/2021, 4:00 PM
    Hello https://github.com/JetBrains/skiko/commit/8cde16e17cd01d7e8efc5e903f42266bb22c91df
    👀 5
    :kotlin-intensifies: 2
    d
    1 reply · 2 participants
  • i

    Ivan Đorđević

    10/12/2021, 11:12 AM
    Hi, where exactly is the
    embedAndSignAppleFrameworkForXcode
    task defined? I'm running the
    kmm-integration-samples
    test project, and when I simply run the iOS target it builds successfully:
    > Task :shared:linkDebugFrameworkIosX64
    > Task :shared:assembleDebugAppleFrameworkForXcodeIosX64
    > Task :shared:embedAndSignAppleFrameworkForXcode
    
    BUILD SUCCESSFUL in 13s
    4 actionable tasks: 4 executed
    But I can't see such a task in Gradle tasks, and when I try to run the task manually, Gradle can't seem to find it:
    $ ./gradlew :shared:embedAndSignAppleFrameworkForXcode
    
    > Configure project :shared
    Kotlin Multiplatform Projects are an Alpha feature. See: <https://kotlinlang.org/docs/reference/evolution/components-stability.html>. To hide this message, add 'kotlin.mpp.stability.nowarn=true' to the Gradle properties.
    
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Task 'embedAndSignAppleFrameworkForXcode' not found in project ':shared'.
    h
    2 replies · 2 participants
  • m

    marzelwidmer

    10/21/2021, 6:17 PM
    Hello can I use the Preview also in appCode like on xcode ?
    z
    p
    3 replies · 3 participants
  • s

    salomonbrys

    11/04/2021, 7:07 PM
    Hey guys. How can we use InjectionIII with the new KMM project with Gradle generating the Xcodeproject ? In essence, I'd like to use this method : https://www.jetbrains.com/help/objc/create-a-swiftui-application.html but in a project created by AppCode with Gradle.
    a
    4 replies · 2 participants
  • w

    Will Hess

    11/09/2021, 7:15 PM
    I am running into an issue regarding duplicate frameworks with cocoapods. I am trying to consume a kotlin generated framework into 3 modules inside of my xcode projects: • iosSdk • iosSdkUx • iosSdkSampleApplication I have tried adding this flag to the kotlin project, but am still running into the error.
    kotlin.native.cacheKind=none
    I also have a post install script inside of my podfile which was working when I was only consuming the kotlin generated framework in
    iosSdk
    and
    iosSdkUx
    . But when trying to add the third it fails (
    iosSdkSampleApplication
    ). (SEE THREAD FOR PODFILE) Here is the error I am getting:
    objc[29904]: Class ISSDouble is implemented in both /Users/ME/Library/Developer/Xcode/DerivedData/iosSdk-ftsmsdlkscvzlmdbohckpjheeupx/Build/Products/Debug-iphonesimulator/iosSdkUx.framework/iosSdkUx (0x110508d60) and /Users/ME/Library/Developer/CoreSimulator/Devices/7C739BFB-DFD9-4F88-A2D4-4185065B258D/data/Containers/Bundle/Application/C98D5D0A-45C5-43F5-A4AA-70C42E3E283F/iosSdkSampleApplication.app/iosSdkSampleApplication (0x103bbb2f0). One of the two will be used. Which one is undefined.
    3 replies · 1 participant
  • m

    Michael Langford

    11/15/2021, 5:45 PM
    Hi there! Looking to find out if anyone is using https://kotlinlang.org/docs/apple-framework.html in practice here in their shipping apps that otherwise use Swift and if there were any big pain points/tool lag that made that higher "cost" than it may appear at first glance
    b
    4 replies · 2 participants
  • a

    alexeenkoff

    11/17/2021, 2:07 PM
    Hi there! Help with looking for the best practice work on coroutines flow from swift. Any articles or github examples
    r
    t
    2 replies · 3 participants
  • c

    crumpf

    11/18/2021, 6:28 PM
    Advance apologies, on this being a long one. I’m working on a KMM module and not strong with gradle. I’m trying to use the gradle XCFramework plugin in conjunction cocoapods for external dependency management, and I have several questions about how to make all the iOS pieces play together. Below is basically what the iOS outline of my gradle looks like (reduced to the relevant iOS bits)
    import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
    import org.jetbrains.kotlin.gradle.plugin.mpp.apple.XCFramework
    
    val bitcode: String = if ("release".equals(configuration, true)) "bitcode" else "marker"
    val iosFrameworkName = "FooFramework"
    
    kotlin {
        
        val xcf = XCFramework(iosFrameworkName)
    
        ios {
            binaries.framework {
                xcf.add(this)
            }
        }
    
        val iosTarget: (String, KotlinNativeTarget.() -> Unit) -> KotlinNativeTarget = when {
            System.getenv("SDK_NAME")?.startsWith("iphoneos") == true -> ::iosArm64
            System.getenv("NATIVE_ARCH")?.startsWith("arm") == true -> ::iosSimulatorArm64
            else -> ::iosX64
        }
        iosTarget("ios") {}
    
        cocoapods {
            summary = "summary here"
            homepage = "<https://www.example.com>"
            ios.deploymentTarget = "10.0"
            podfile = project.file("../iosApp/Podfile")
            framework {
                baseName = iosFrameworkName
                freeCompilerArgs += listOf("-module-name", "FOO")
                embedBitcode(bitcode)
            }
            pod("AFNetworking", "~> 4.0.1")
        }
    
    }
    First question: Am I doing it wrong? 😀 Second question: Is it right to configure the framework (baseName, module-name, etc) inside the
    cocoapods
    extension instead of the
    ios
    target? Third question: When set up this way, the
    iosTarget
    workaround to for the IDE in conjunction with cocoapods reports exceptions about the x64 architecture already having a binary:
    Cannot add binary podDebugFramework dependency to default fat framework
    java.lang.IllegalArgumentException: This fat framework already has a binary for architecture `x64` (podDebugFramework for target `iosX64`)…
    
    Cannot add binary podReleaseFramework dependency to default fat framework
    java.lang.IllegalArgumentException: This fat framework already has a binary for architecture `x64` (podReleaseFramework for target `iosX64`)…
    Even though things seem to build successfully, even with these pod<config>Framework exceptions, is there a possibility of a problem rearing its head? Is there something I can do to clean the exceptions up? references: Build XCFramework: https://kotlinlang.org/docs/mpp-build-native-binaries.html#build-xcframeworks iOS dependencies with CocoaPods: https://kotlinlang.org/docs/kmm-add-dependencies.html#with-cocoapods Note for iOS dependencies needing workaround to get code completion/highlighting in the IDE for the 3rd party libs https://kotlinlang.org/docs/kmm-add-dependencies.html#workaround-to-enable-ide-support-for-the-shared-ios-source-set
    1 reply · 1 participant
  • a

    Alexis Hernandez

    11/24/2021, 5:57 PM
    Hi everybody, I wonder if anyone has managed to use gRPC <> iOS with Kotlin Multiplatform, until now, we have had lots of issues, I found out that https://github.com/grpc/grpc-kotlin seems to be a pure Kotlin implementation but I haven't tried it for IOS Thanks
    p
    10 replies · 2 participants
  • n

    Nikolay Kasyanov

    11/25/2021, 2:05 PM
    hello folks 👋 Let’s say I have an abstract class in Kotlin that is subclassed from Swift. This subclass is then instantiated and passed to Kotlin code. Is there a way to get Swift’s subclass name from Kotlin?
    p
    l
    3 replies · 3 participants
  • i

    Iain Merrick

    12/02/2021, 5:12 PM
    Does freezing typically occur only when objects are passed across thread boundaries? Or are there other cases?
    r
    r
    7 replies · 3 participants
  • b

    Brian G

    12/06/2021, 11:51 PM
    For my Android app, I have ~60 app "variants", which each have a handful of key/value config options + a folder of assets specific to that variant... Any way to achieve something similar with org.jetbrains.gradle.apple.applePlugin?
    😱 2
    k
    2 replies · 2 participants
  • b

    Brian G

    12/07/2021, 1:02 AM
    How do you add iOS dependencies (e.g. cocoapods) to an app built with org.jetbrains.gradle.apple.applePlugin?
    k
    2 replies · 2 participants
Powered by Linen
Title
b

Brian G

12/07/2021, 1:02 AM
How do you add iOS dependencies (e.g. cocoapods) to an app built with org.jetbrains.gradle.apple.applePlugin?
k

Konrad Sztenderski

12/08/2021, 12:50 PM
Hi, you have to add cocoapods plugin to your project. You can just follow these instructions https://kotlinlang.org/docs/native-cocoapods.html#install-the-cocoapods-dependency-manager-and-plugin. And then add project with cocoapods to dependencies like this:
apple {
    iosApp {
        dependencies {
           implementation(project(":project_with_cocoapods"))
        }
    }
}
If cocoapods are located in the same project then they are automatically added.
b

Brian G

12/08/2021, 4:45 PM
So, the only way to add a dependency to the app to create a separate gradle module, and add the dependency there? Seems a little roundabout, but I guess I can make that work.
View count: 9