https://kotlinlang.org logo
#compose
Title
# compose
i

Ido Flax

11/29/2023, 8:03 PM
@zsmb Is the project in the

compose demo

available on github? there’s no link in the comments or chat
s

Swapnil Musale

11/30/2023, 6:12 AM
z

zsmb

11/30/2023, 8:20 AM
That's the one! It won't match the live demo 100% because we had to deviate a bit to fit things in for time and actually build it live, but it's 95% the same code.
i

Ido Flax

11/30/2023, 10:03 AM
Thanks guys! i’m getting my app dev feet wet for the first time after 8 years of backending and i’m excited to use Kotlin for it :D
👍 2
@zsmb There seems to be an issue with android studio and compose, when i pull this project, or init a new project from the web wizard, the IEDA says “kotlin not configured”. if i try and fix it by clicking configure, it adds the “org.jetbrains.kotlin.android” plugin to both gradle build files, which is wrong and causes build errors
1
another question, is there a way to centrelize the java version config so we don;t have to do both
Copy code
kotlin {
    androidTarget {
        compilations.all {
            kotlinOptions {
                jvmTarget = "11"
            }
        }
    }
and
Copy code
android {
    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_11
        targetCompatibility = JavaVersion.VERSION_11
    }
}
?
And regarding the android studio config issue, this also keeps popping up:
Copy code
Duplicate content roots detected

Path [/Users/ido/IdeaProjects/Lineup/composeApp/src/commonMain/resources] of module [Lineup.composeApp.commonMain] was removed from modules [Lineup.composeApp.main]
1
z

zsmb

11/30/2023, 11:25 AM
Kotlin not configured
Could you try using Android Studio Hedgehog? I believe this was a bug that was present in Giraffe with Kotlin 1.9, that you'd get that warning sometimes. In Hedgehog it should be fixed.
Java versions
Using
jvmToolchain
might help you depending on your project's needs, but it's complicated, see this page for example.
Duplicate content roots detected
Not sure where this issue is coming from, but it's being tracked here for example, vote for it if you're affected: https://youtrack.jetbrains.com/issue/KT-63925/
i

Ido Flax

11/30/2023, 11:59 AM
@zsmb first issue fixed with hedgehog. duplicate content roots still happening. i wonder why both commonMain/kotlin and commonMain/resources appear as source roots, whereas in intellij, normal kotlin mp projects, commonMin is the root and kotlin is src and resources is resources (as is normal)
z

zsmb

11/30/2023, 12:06 PM
I've just been pointed to a better reference point for the issue, you can find out more about it here: https://github.com/JetBrains/compose-multiplatform/issues/2913
2 Views