I just merged (<https://android-review.googlesourc...
# compose
j
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
is there any eta right now for the alpha release that will support this?
j
After thanksgiving.
j
ok, thanks
i
Thankful Gifts ๐Ÿ™‚
c
Might be a dumb question. But how does one use a snapshot build?
j
c
@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
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
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
Cool. It's my first time using a snapshot so I'm glad to see that it's probably not my fault. ๐Ÿ˜„
a
@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
@Alexjlockwood are you able to use the latest compose snapshot? I keep getting the error I posted above.
a
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
Awesome. Glad I'm in good company. ๐Ÿ˜ƒ
a
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
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
that all looks the same to me. my suspicion is maybe there is something in
~/.gradle/caches
that is screwing things up
c
c
@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
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
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
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
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