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

    Sabrina Namur

    02/19/2021, 8:30 AM
    Hey, is it possible to generate common tests dynamically (with a for loop)? I'm using the kmm plugin and have only andorid and ios as targets. I tried to set up junit5 and use TestFactory Annotations but it does not work.
    b
    • 2
    • 4
  • s

    Sam

    02/19/2021, 6:49 PM
    Hello everyone, I have an idea to build Messenger/Chap desktop app like telegram ( I want to use KMM to supported Mac,Windows, Linux, iOS, Android, Web) My goal is using compose-desktop + KMM So I have some questions: 1. is Ktor can handle network for Mac,Windows, Linux, iOS, Android, Web? 2. Which MQTT libs can suitable for Mac,Windows, Linux, iOS, Android, Web? 3. How to include C++ for KMM? example https://github.com/Samsung/rlottie Thanks.
    c
    a
    m
    • 4
    • 3
  • e

    Ekaterina Volodko [JB]

    02/20/2021, 10:22 AM
    Hi all. Thank you for all your feedback on the Integrate KMM into an existing application article. We’ve completely revamped this article and created a practical step-by-step tutorial with a sample project. Its new name is Make your Android application work on iOS 📱. We’ll greatly appreciate your feedback on the new tutorial in :thread-please: or YouTrack. We want to understand whether we’re going in the right direction and create content that is helpful for you! Have a great day! 🙂
    j
    t
    • 3
    • 4
  • k

    kevindmoore

    02/20/2021, 6:19 PM
    I am using the latest Canary Android Studio and just creating a sample KMM project does not compile/sync
    p
    • 2
    • 3
  • a

    Adam Brown

    02/20/2021, 10:05 PM
    I'm working on a multiplatform compose project, but I can't seem to get dependencies to include properly in my
    commonMain
    module. I add the dependency the way I assume it should work, but it doesn't seem to be included when I'm in source files in
    commonMain
    any ideas what I could be doing wrong?
    a
    d
    • 3
    • 44
  • a

    Abhishek Dewan

    02/22/2021, 4:24 AM
    Does anyone know why my unit tests testing coroutine stuff doesn’t actually ever stop running
    m
    n
    u
    • 4
    • 7
  • a

    Amritansh

    02/22/2021, 6:49 PM
    Hi, my 
    compileKotlinMetadata
     task is failing in a KMM project when I run
    ./gradlew build
    and I am getting following error. My app runs and build fine when I use IDE, this error only occurs when I use terminal to build or on my CI
    DatabaseDispatcher.kt: (4, 27): Unresolved reference: newSingleThreadContext
    DatabaseDispatcher.kt: (9, 36): Unresolved reference: newSingleThreadContext
    DatabaseDispatcher.kt: (12, 47): Type mismatch: inferred type is Unit but CoroutineContext was expected
    This is the class where it is failing
    internal object DatabaseDispatcher : BackgroundDispatcher {
        @ExperimentalCoroutinesApi
        private val dbThread by lazy { newSingleThreadContext("database") }
    
        @ExperimentalCoroutinesApi
        override fun invoke(): CoroutineContext = dbThread
    
    }
    I am using these dependendies
    kotlin = "1.4.30"
    coroutines = "1.3.9-native-mt-2"
    serialization = "1.0.1"
    ktor = "1.4.3"
    klock = "2.0.0"
    benasherUUID = "0.2.3"
    stately = "1.1.0"
    junit = "4.12"
    sqlDelight = "1.4.3"
    This is how my
    build.gradle
    looks like
    🙌 1
    m
    • 2
    • 1
  • c

    Cicero

    02/22/2021, 7:09 PM
    Adding to the list of crazy things that happen with KMP:
    * What went wrong:
    An exception occurred applying plugin request [id: 'com.android.application']
    > Failed to apply plugin 'com.android.internal.application'.
      > Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
       You can try some of the following options:
        - changing the IDE settings.
        - changing the JAVA_HOME environment variable.
        - changing `org.gradle.java.home` in `gradle.properties`.
    Yes, so I actually changed my java system version:
    11:~ ch$ $JAVA_HOME/bin/java -version
    java version "11.0.10" 2021-01-19 LTS
    Java(TM) SE Runtime Environment 18.9 (build 11.0.10+8-LTS-162)
    Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.10+8-LTS-162, mixed mode)
    11:~ ch$
    a
    • 2
    • 23
  • j

    John Oberhauser

    02/23/2021, 5:15 AM
    Is there a recommend way to encrypt a database in KMP? I've got SqlDelight set up, and SQL Cipher for android from here https://github.com/sqlcipher/android-database-sqlcipher But I'm not sure what to do about desktop and ios. I'm looking to be able to create a backup of one encrypted database of one platform, and decrypt it in another. edit: this looks like it'll work for JVM (desktop) https://github.com/Willena/sqlite-jdbc-crypt/tree/3.33.0.1 still not sure about ios though
    i
    k
    • 3
    • 3
  • b

    Ben Lancaster

    02/23/2021, 3:36 PM
    Hello, I am attempting to separate my Multiplatform project up in to several modules to be compiled in to one artefact for iOS and Android. If the main module, let’s called it
    Primary
    , has a class called
    Timeline
    in kotlin, then this is what I see in the iOS framework header:
    __attribute__((swift_name("Timeline")))
    @interface ServiceManagerTimeline : ServiceManagerBase
    That’s good, it means in Swift I can use a class called
    Timeline
    . But if I have a class in the second module, called
    ServiceManager-common
    (a dependency of
    Primary
    ), for example, the class
    ClientData
    in kotlin, then this is what the header has:
    __attribute__((swift_name("ServiceManager_commonClientData")))
    @interface ServiceManagerServiceManager_commonClientData : ServiceManagerBase
    Which means in Swift I have to use
    ServiceManager_commonClientData
    class, instead of just
    ClientData
    . So, looks like that the generated framework always use the second module name as a prefix for all the classes in the second module. I guess that KM does this because to avoid a potential name collision, given that there is no concept of namespace in Swift/ObjC. However, in my case, I am sure there is no name collision. How can I deactivate or override this behavior? Another option I see (I tested it and it is working) is modifying the final .h file and manually modify all the
    swift_name
    tags. Not very nice, but works. I also tried using
    baseName = ""
    in the second module but no luck. Any ideas or suggestions welcome. Thanks in advance.
    • 1
    • 1
  • g

    Guilherme Cordeiro

    02/23/2021, 8:49 PM
    Hello! Maybe I am doing something wrong without realizing, but I am struggling to share code between different KMM modules... If I have: 1. A base KMM module, with code both on
    commonMain
    and
    commonTest
    that I want to share (like frameworks, contracts, test utilities, etc) 2. Several other independently built modules, depending on the base module What is the proper way to add the base module on the dependencies of the child modules? Inside the
    sourceSets
    block, for both
    commonMain
    and
    commonTest
    ? Can I access classes defined on the base module
    commonTest
    inside a child module
    commonTest
    ?
    e
    a
    +2
    • 5
    • 12
  • n

    nikola

    02/24/2021, 5:57 AM
    Hi all. I am trying to migrate from build.gradle (Groovy) to build.gradle.kts and I am stuck with translating certain part related to tasks. When running build I do not see this task executing. What am I doing wrong?
    // -----------Groovy Old
    task generateCinteropConfig(type: Exec) {
        workingDir "${projectDir}"
        commandLine 'sh', "${projectDir}/generate_cinterop_conf.sh"
    }
    
    gradle.taskGraph.beforeTask { Task task ->
        if (task.project.name.toLowerCase().contains("ios")) {
            "sh ${projectDir}/generate_cinterop_conf.sh ${projectDir}".execute().text
        }
    }
    
    // ------------Kotlin DSL New
    task<Exec>("generateCinteropConfig") {
        workingDir = File("${projectDir}")
        commandLine = listOf("sh", "${projectDir}/generate_cinterop_conf.sh")
    }
    
    tasks.register("generateCinteropConfig") {
        doFirst() {
            if (this.project.name.toLowerCase().contains("ios")) {
                Runtime.getRuntime().exec("${projectDir}/generate_cinterop_conf.sh ${projectDir}")
            }
        }
    }
    ✅ 1
    k
    • 2
    • 6
  • m

    Mariusz Tański

    02/25/2021, 12:49 PM
    Hi everyone! does anyone have experience using koin + multimodules architecture? I have “:shared” module that inclues a “:networking” module. In the networking module I have module {singleton { A() }}. Everything works in the android app, but in the ios app runtime I get an error:
    Koin Context configured. Please use startKoin or koinApplication DSL.
    m
    m
    • 3
    • 6
  • z

    zalewski.se

    02/25/2021, 6:19 PM
    So I updated my AS via JetBrains ToolBox to latest canary version which is Arctic Fox 2020.3.1 Canary 8 and it’s crushing on startup because of KMM plugin 🤔 It was working fine on Canary 7 though. Stacktrace in 🧵
    👀 2
    c
    a
    +3
    • 6
    • 16
  • n

    nirazo

    02/26/2021, 3:35 AM
    Hello! On my project, I make UseCases in Kotlin and execute UseCase’s  
    execute
     method from APP to get value. The return values from UseCases are defined as Results, and puts it in Output of UseCase, and returns it to my APP. Define of Results:
    sealed class Results<out T, out S> {
        class Success<out T>(val data: T) : Results<T, Nothing>()
        class Failure<out S>(val cause: S) : Results<Nothing, S>()
    }
    Sample useCase and it’s IO:
    interface SampleUseCaseInterface {
        suspend fun execute(): sampleUseCaseIO.Output
    }
    
    class sampleUseCase() : SampleUseCaseInterface {
        override suspend fun execute(): sampleUseCaseIO.Output =
            sampleUseCaseIO.Output(Results.Success("success!"))
    }
    
    class sampleUseCaseIO {
        data class Output(val results: Results<String, Error>)
    }
    Now, I want to mock the execute method of UseCase and return an arbitrary Output in order to write a Unit Test in an iOS app. However, now the following error is displayed and it is not possible to create an arbitrary output. Both data and error are required to be included in Results, and the required Output cannot be created. Is there any way to avoid this? Also, is it possible to realize a mechanism like Either on the iOS side with Kotlin/Native?
    y
    c
    a
    • 4
    • 9
  • e

    Eirik Vale Aase

    02/26/2021, 8:38 AM
    Has anyone integrated AppCenter crash reporting SDK into a multiplatform application? Is it something that would be better implemented on the platforms?
    d
    • 2
    • 6
  • j

    Jeff Lockhart

    02/27/2021, 7:07 PM
    I'm using Koin
    api("org.koin:koin-core:3.0.0-alpha-4")
    and when I add Ktor
    implementation("io.ktor:ktor-client-core:1.5.2")
    to my build.gradle.kts, all the Koin
    org.koin.*
    imports start showing errors “Unresolved reference” in Android Studio 4.2-beta5. This is in a shared KMM module. My app compiles and runs without error. But why the IDE errors?
    j
    v
    +2
    • 5
    • 8
  • r

    Rob Murdock

    02/28/2021, 8:57 PM
    I just finished porting my kotlin multiplatform library from being hosted on bintray to being hosted on maven central, so if anyone else is going through that or just wants to chat about it… here’s a thread for that!
    c
    r
    • 3
    • 6
  • m

    Mustafa Ozhan

    03/01/2021, 9:56 AM
    I am happy to announce that I have finally migrated my Android app completely to Kotlin Multiplatform and it is in Production now :kotlin-intensifies: Backend is in beta and iOS is still in progress 🙂 I am also planing to write an article about the Architecture(MVVM-SEED) I use in the project later and will post here as well 🙂 Please fell free to check my project and give your feed-back, you are so much welcome to write me in personal or comment under this or Create Issue/PR/Discussion or give Star in GitHub 🙂 I would like to thank for this great community! Happy Coding 💪 https://github.com/CurrencyConverterCalculator/CCC
    :kotlin-intensifies: 11
    👍🏼 1
    🙏🏼 1
    👍 15
    👏 4
    👏🏼 1
    🎉 8
    🙏 1
    s
    u
    s
    • 4
    • 7
  • k

    Ky

    03/01/2021, 3:54 PM
    Hey guys, one of my side projects is an android twitter app using jetpack compose. At some point I decided to just create a library for the new Twitter V2 api, I’m using retrofit and OKHTTP for networking but since I’ve started digging into iOS development I’ve decided I want the library to also be accessible for iOS. Looking at the Ktor docs, it seems pretty straight forward to create some common networking code and platform specific implementations for the things that cannot be shared. Does it make sense to take advantage of KMM here? I think it does, but most of the examples I see around are of KMM applications, all the code is in a single project and not really any ‘libraries’ . I want to provide a library which another person could leverage to create either an Android, iOS or even a KMM app if they wanted to. Thanks
    k
    p
    • 3
    • 10
  • a

    Archie

    03/01/2021, 5:02 PM
    Hi Guys, would like to ask for suggestion on what library to use for Data and Time for KMM?
    j
    m
    r
    • 4
    • 7
  • d

    Daniel Burnhan

    03/02/2021, 3:35 AM
    For those developing KMM with common APIs between IOS and Android, how are you handling the dependency injection in IOS?
    k
    m
    • 3
    • 2
  • a

    aleksey.tomin

    03/02/2021, 8:09 AM
    I have KMP project with macOS/iOS/Android/Windows targets. In common code I use
    kotlinx.coroutines.newSingleThreadContext
    Build for the all targets done without error. But if I call
    gradle compileKotlinMetadata
    I see error
    > Task :compileKotlinMetadata FAILED
    e: <...>.kt: (28, 9): Unresolved reference: newSingleThreadContext
    How can I fix it?
    a
    • 2
    • 3
  • b

    Bill Mårtensson

    03/02/2021, 10:09 AM
    What is the status of KMM iOS on M1 macs? If I create new project in android studio with KMM plugin, open iOS project in Xcode and run on simulator I get error.
    a
    a
    • 3
    • 3
  • r

    rmyhal

    03/02/2021, 12:39 PM
    Hello, what could be the problem that I see only
    ios
    and
    iosX64
    configurations for running tests for
    commonTest
    and don’t see android?. Project has two targets: android & ios. Thanks. gradle config:
    plugins {
        kotlin("multiplatform")
        id("com.android.library")
    }
    
    kotlin {
        android()
        ios {
            binaries {
                framework {
                    baseName = "shared"
                }
            }
        }
        val isiOSDevice = System.getenv("SDK_NAME").orEmpty().startsWith("iphoneos")
        if (isiOSDevice) {
            iosArm64("ios")
        } else {
            iosX64("ios")
        }
        sourceSets {
            val commonTest by getting {
                dependencies {
                    implementation(kotlin("test-common"))
                    implementation(kotlin("test-annotations-common"))
                }
            }
        }
    
        explicitApi()
    }
    
    android {
        compileSdkVersion(30)
        sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
        defaultConfig {
            minSdkVersion(23)
            targetSdkVersion(30)
        }
    }
    
    tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
        kotlinOptions {
            jvmTarget = "1.8"
        }
    }
    t
    r
    k
    • 4
    • 6
  • b

    bsimmons

    03/02/2021, 4:55 PM
    What is the recommend way to use
    runBlocking
    for unit tests in a MPP for native/ios? It looks like kotlinx-coroutines-core:1.4.1 doesn't include
    runBlocking
    for native.
    j
    c
    +3
    • 6
    • 33
  • s

    Shawn Tucker

    03/03/2021, 2:25 PM
    I am getting this issue when trying to build framework for iOS
    > Task :linkReleaseFrameworkIos
    ld: framework not found FirebaseFirestore
    It happened when I added gitlive/firebase dependency to my project. I have a second project that have the same dependency and it works. Only difference is that in my other project I have cocoapods plugins. What am I missing?
    t
    c
    • 3
    • 4
  • a

    Alex

    03/03/2021, 5:39 PM
    Hello, all! I'm new to Kotlin Multiplatform, trying to use some of my iOS libs code in the Kotlin common code, but I'm having some problems with the cinterop configuration. The klib file seems to be built but when I'm trying to import a class to be used in Kotlin, it's not finding it (not even the package). I've seen that there's a klib utility to inspect it, but I can't find that klib utility. where can I get it?
    k
    • 2
    • 4
  • m

    Mario Ruiz

    03/03/2021, 5:43 PM
    Is there any guide for creating a library that targets Android, regular JVM, and JS ?
    b
    • 2
    • 2
  • g

    Gabriel Feo

    03/04/2021, 12:14 AM
    Is it possible in any way to use a compiler plugin with only one of the multiplatform targets? (does that even make sense?) My use case is Anvil, which only support JVM or Android projects for now
    j
    r
    • 3
    • 5
Powered by Linen
Title
g

Gabriel Feo

03/04/2021, 12:14 AM
Is it possible in any way to use a compiler plugin with only one of the multiplatform targets? (does that even make sense?) My use case is Anvil, which only support JVM or Android projects for now
j

Javier

03/04/2021, 1:12 AM
I think it should work, the same question were asked in #squarelibraries a few days ago. BTW, why you don't use any Multiplatform DI framework? Kodein, Koin, PopKorn...
g

Gabriel Feo

03/04/2021, 1:23 AM
Thanks, didn’t know that channel! I’m getting an error here saying only JVM or Android projects are supported, even though those are my only targets. I prefer Dagger for compile-time safety, and my project is JVM and Android only
r

rnett

03/04/2021, 3:01 AM
I didn't see an answer (well, other than "it doesn't work") and am curious about this as well, from a compiler plugin standpoint. Plugins can detect the platform and disable themselves if it's not supported (either in the plugin itself or the gradle plugin), but I don't know of a way to specify it user side. There definitely should be one though. Someone (I will of no one else) should make an issue requesting it if no solution comes up. The best workaround is probably to make your own gradle plugin (using
KotlinCompilerPluginSupportPlugin
) and set
isApplicable
properly. You could also experiment with including the plugin jar manually, although I'm not sure if you can set different compiler args per target.
Reposting this in #compiler, too
It seems to be tracked in https://youtrack.jetbrains.com/issue/KT-27217
View count: 3