https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
c

christophsturm

05/26/2020, 4:42 PM
in a multiplatform project how can i use the gradle platform feature?
Copy code
kotlin {
    jvm()
    sourceSets {
        val jvmMain by getting {
            dependencies {
                implementation(enforcedPlatform("org.jetbrains.kotlin:kotlin-bom:$kotlinVersion"))
the
enforcedPlatform
part is highlighted in red in my gradle file
l

louiscad

05/26/2020, 5:00 PM
@christophsturm Use
platform
instead.
c

christophsturm

05/26/2020, 5:08 PM
thanks. i thought that both is not supported
actually platform also does not work 🙂
l

louiscad

05/26/2020, 7:27 PM
What does "also does not work" mean? Do you expect me or others to guess what happens exactly?
👎 2
c

christophsturm

05/26/2020, 8:12 PM
It fails exactly the same way. It’s also red.
l

louiscad

05/26/2020, 8:58 PM
red, but does it compile?
c

christophsturm

05/27/2020, 10:13 AM
no. it says
Unresolved reference: platform
🙂
d

Darren Bell

07/21/2020, 8:13 AM
@christophsturm I am also trying to get
platform
or
enforcedPlatform
to work as part of my multiplatform project. I too am having the same issue as you. Did you get it resolved? Or what did you do to work around it?
c

christophsturm

07/21/2020, 8:25 AM
I just commented it out „for now“ :)
Was hoping for someone at JetBrains to comment, maybe it’s time for a youtrack
d

Darren Bell

07/21/2020, 8:36 AM
Yes, that's disappointing. Did you just manually add your dependencies instead?
Help has been provided in the ticket. There are two options, the most natural one to me is:
Copy code
val jvmMain by getting {
    dependencies {
        implementation(project.dependencies.enforcedPlatform("..."))
    }
}
🙌 1
1
c

christophsturm

07/23/2020, 8:17 AM
thanks
3 Views