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

Geert

09/18/2020, 11:34 AM
I just upgraded to AS 4.2 Canary 11. But I think I have lost the correct dependency versions. Build.gradle
Copy code
classpath "com.android.tools.build:gradle:4.2.0-alpha11"
Dependencies:
Copy code
object Compose {
            const val snapshot = ""
            const val version = "1.0.0-alpha01"

            const val core = "androidx.compose.ui:ui:$version"
            const val foundation = "androidx.compose.foundation:foundation:$version"
            const val layout = "androidx.compose.foundation:foundation-layout:$version"
            const val material = "androidx.compose.material:material:$version"
            const val materialIconsExtended = "androidx.compose.material:material-icons-extended:$version"
            const val runtime = "androidx.compose.runtime:runtime:$version"
            const val runtimeLivedata = "androidx.compose.runtime:runtime-livedata:$version"
            const val tooling = "androidx.ui:ui-tooling:$version"
            const val test = "androidx.compose.test:test-core:$version"
            const val uiTest = "androidx.ui:ui-test:$version"
        }
I think I need to update the compiler version, but cant find any updates for compose anymore.
Tried “1.0.0-alpha01”, “1.0.0-alpha02" and “1.0.0-alpha03” but makes no difference
j

Javier

09/18/2020, 11:39 AM
Check the Gradle configuration
composeOptions { kotlinCompilerVersion Libs.Kotlin.version kotlinCompilerExtensionVersion Libs.AndroidX.Compose.version }
kotlin version should be 1.4 (or 1.4.10) and compose version alpha03
g

Geert

09/18/2020, 11:43 AM
Copy code
composeOptions {
    kotlinCompilerVersion Libs.Kotlin.version
    kotlinCompilerExtensionVersion Libs.AndroidX.Compose.version
}
Where:
Copy code
private const val version = "1.4.0"
const val version = "1.0.0-alpha01"
Might try 1.4.10 I guess
j

Javier

09/18/2020, 11:44 AM
If it doesn't work maybe you have to add useIR = true in kotlinOptions
g

Geert

09/18/2020, 11:45 AM
Well that could be the solution, I added a new module, but didn’t add that one.
j

Javier

09/18/2020, 11:46 AM
I remember in some version I had to use it there because enabling globally it inside gradle.properties didn't work
s

Se7eN

09/18/2020, 11:51 AM
Make sure your gradle plugin version is 4.2.0-alpha11:
classpath 'com.android.tools.build:gradle:4.2.0-alpha11'
Edit: Nvm just saw you have the correct version
g

Geert

09/18/2020, 11:55 AM
My compiler doesn’t show any errors currently. I have 4.2.0-alpha11 and 1.0.0-alpha3 and useIr true now
2 Views