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

Colton Idle

12/02/2020, 7:56 PM
Trying to enable compose in my project (I'm not actually using it anywhere!) and I've been waiting for alpha08 because of kotlin 1.4.20 support and this is the error I get:
Copy code
androidx.compose.compiler.plugins.kotlin.IncompatibleComposeRuntimeVersionException: You are using an outdated version of Compose Runtime that is not compatible with the version of the Compose Compiler plugin you have installed. The compose compiler plugin you are using (version 1.0.0-alpha08) expects a minimum runtime version of 1.0.0-alpha08.
Anyone else get this?
This is all I'm adding to my app level build.gradle
Copy code
kotlinOptions {
    jvmTarget = '1.8'
    useIR = true
}
buildFeatures {
    compose true
    viewBinding true
}
composeOptions {
    kotlinCompilerVersion '1.4.20'
    kotlinCompilerExtensionVersion '1.0.0-alpha08'
}
root level build.gradle was changed to this:
Copy code
classpath 'com.android.tools.build:gradle:7.0.0-alpha01'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.20"
and gradle was updated to 6.7.1 I've tried cleaning, building, etc. Any other debugging steps I can take here?
j

jaqxues

12/02/2020, 9:56 PM
Did you not update the actual
implementation
clauses?
c

Colton Idle

12/03/2020, 3:11 AM
@jaqxues I'm not actually using anything compose related yet. I'm just trying to enable it in general. So I have no deps with
implementation
yet. @jim or @Leland Richardson [G] any ideas?
j

jim

12/03/2020, 3:30 AM
Do you have anything else in your build files that mentions 
alpha07
?  In particular, what is your 
androidx.compose.runtime:runtime
 dependency version?
c

Colton Idle

12/03/2020, 5:45 AM
@jim I don't have any reference to androidx.compose.runtime. I literally took my existing project, and followed the docs to add compose, so all I added was really this
Copy code
kotlinOptions {
    jvmTarget = '1.8'
    useIR = true
}
buildFeatures {
    compose true
    viewBinding true
}
composeOptions {
    kotlinCompilerVersion '1.4.20'
    kotlinCompilerExtensionVersion '1.0.0-alpha08'
}
and that's enough to not allow me to compile.
@jim that was the issue. 😭 I simply added
implementation "androidx.compose.runtime:runtime:1.0.0-alpha08"
and it worked. Someone should really clarify in the "Add Jetpack Compose to an existing project" what is mandatory and what's not 😄 https://developer.android.com/jetpack/compose/setup#add-compose It tells you have to configure kotlin, and gradle, but the toolkit dependencies seem optional. tooling previews, material, etc. No mention of
androidx.compose.runtime:runtime:
So close! My issue of simply enabling compose causing kotlin reflect to break still exists in 1.4.20 and alpha-08. 😭 https://issuetracker.google.com/issues/174692120
@jim you fixed it!!! Thank you thank you thank you. We've been wanting to add compose to our project for what feels like months... but could never even simply enable it. Now we'll be able to. Can't wait to try the snapshot/alpha09!!! ❤️
@jim just used a snapshot that became available. Compose works. finally. and it's beautiful 😭
🎉 2
j

jim

12/03/2020, 10:02 PM
🎉 Glad to hear it!
3 Views