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

jim

11/20/2020, 5:35 PM
I just merged (https://android-review.googlesource.com/c/platform/frameworks/support/+/1506451) support for Kotlin 1.4.20, so for those of you who like living on the edge, a compatible build should appear in the snapshots server very shortly. For the rest of you, it means our next alpha release.
🦜 9
🎉 29
🙏🏼 3
j

John O'Reilly

11/20/2020, 5:38 PM
is there any eta right now for the alpha release that will support this?
j

jim

11/20/2020, 5:41 PM
After thanksgiving.
j

John O'Reilly

11/20/2020, 5:48 PM
ok, thanks
i

itnoles

11/20/2020, 6:11 PM
Thankful Gifts 🙂
c

Colton Idle

11/20/2020, 9:20 PM
Might be a dumb question. But how does one use a snapshot build?
c

Colton Idle

11/21/2020, 5:50 PM
@jim getting this error
e: 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.
j

jim

11/21/2020, 5:59 PM
Yeah, it's hard to tell what's going on there because it tells you that it expects a minimum runtime version, but it doesn't tell you what version it thinks you're using. Assuming the verification is correct, you would need to confirm you're fetching your runtime jars from the same snapshot server that you're getting the compiler from (ie. not from gmaven). It's also conceivable there is a bug in how snapshot versions are compared, but again, hard to tell without it telling you what it thinks the runtime version is. cc @Leland Richardson [G]
l

Leland Richardson [G]

11/21/2020, 6:17 PM
Hmm. I'll look at this when I get home. I'm not sure this logic was written to deal with snapshot versioning appropriately
c

Colton Idle

11/22/2020, 2:29 AM
Cool. It's my first time using a snapshot so I'm glad to see that it's probably not my fault. 😄
a

Alexjlockwood

11/22/2020, 11:41 PM
@cb any chance we could generate a snapshot for accompanist v0.3.3 that is compatible with the most recent compose snapshot? seems like the last snapshot that was generated was 2 days before jim merged his CL
c

Colton Idle

11/22/2020, 11:43 PM
@Alexjlockwood are you able to use the latest compose snapshot? I keep getting the error I posted above.
a

Alexjlockwood

11/22/2020, 11:58 PM
i havent gotten it working yet no. was gonna try again tomorrow. i was seeing the same error you are getting on friday though
c

Colton Idle

11/22/2020, 11:58 PM
Awesome. Glad I'm in good company. 😃
a

Alexjlockwood

11/23/2020, 12:38 AM
ah i was able to get it working in a demo project by using
./gradlew --stop
first. i think there was some caching going on behind the scenes that was causing the wrong deps to be used or something 🤷
c

Colton Idle

11/23/2020, 1:59 AM
Didn't work for me unfortunately. Anything else you did that could have led to it working magically? 86 actionable tasks: 1 executed, 85 up-to-date $ ./gradlew --stop Stopping Daemon(s) 1 Daemon stopped ./gradlew assembleFreeDebug e: 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. @Alexjlockwood maybe you can confirm what version numbers you're using? My app build.gradle
Copy code
kotlinOptions {
        jvmTarget = '1.8'
        useIR = true
    }
    buildFeatures {
        compose true
        viewBinding true
    }
    composeOptions {
        kotlinCompilerVersion '1.4.20'
        kotlinCompilerExtensionVersion '1.0.0-SNAPSHOT'
    }
and
Copy code
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.4.20"
    implementation "org.jetbrains.kotlin:kotlin-reflect:1.4.20"
my root build.gradle
Copy code
classpath 'com.android.tools.build:gradle:4.2.0-alpha16'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.20"
Anything look different from your set up?
a

Alexjlockwood

11/23/2020, 3:36 AM
that all looks the same to me. my suspicion is maybe there is something in
~/.gradle/caches
that is screwing things up
c

cb

11/23/2020, 1:07 PM
c

Colton Idle

11/23/2020, 2:12 PM
@Alexjlockwood thanks for the response, unfortunately I wiped .gradle/caches and ./gradlew --stop a bunch of different times to no avail. Looks like maybe I have a different issue?
Giving up for now. Maybe @Leland Richardson [G] can point out if I'm missing something, but I guess at this point I'll have to just wait for alpha-08 to see if compose actually works in a project that uses reflection 🤞
l

Leland Richardson [G]

11/23/2020, 4:48 PM
You can check to see if an empty compose project targeting a snapshot works (no 3rd party dependencies).
i’m on PTO for this week though but will try and take a look at this particular problem as soon as i have time
c

Colton Idle

11/23/2020, 4:58 PM
No worries. I hate tagging people because you never know when they are on holiday. Please enjoy your time off! (i'll use this thread if I make progress)
a

Alexjlockwood

11/23/2020, 7:34 PM
seems like the main downside of the snapshot is that
@Preview
composables no longer work. i think it is because
@Preview
was moved to a different package. i guess this will start working in the next android studio canary release though?
c

Colton Idle

11/24/2020, 6:32 AM
Ooh. That sucks! Currently I can't even use compose because simply enabling it in a project that uses reflection leads to a crash so I'm hoping kotlin 1.4.20 fixes it. If you feel like compose + supporting reflection is important... please star for visibility 😄 https://issuetracker.google.com/issues/171726539