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

Fudge

07/27/2020, 1:46 PM
Looks like upgrading the kotlin plugin to 1.4 rc broke my project 🙂
b

brandonmcansh

07/27/2020, 2:04 PM
Copy code
android {
    buildFeatures {
        compose true
    }
    composeOptions {
        kotlinCompilerExtensionVersion "${compose_version}"
        kotlinCompilerVersion "1.4.0-dev-withExperimentalGoogleExtensions-20200720"
    }
}
Did you update the compiler version?
h

Horv

07/27/2020, 2:11 PM
Having the same issue when adding Jetpack Compose to my project. I have the compiler version in my configuration.
b

brandonmcansh

07/27/2020, 2:11 PM
is your project single module or multi? It has to be applied to all modules
h

Horv

07/27/2020, 2:18 PM
Single (just
app
included). You can view my current experimentation here: https://github.com/fredagsdeploy/cheer-with-me/tree/feature/jetpack-compose/android if that's any help. I've more or less copied the sample here https://github.com/romainguy/sample-materials-shop for the gradle configuration
And I'm running Android Studio Canary :
Copy code
Android Studio 4.2 Canary 5
Build #AI-201.7846.76.42.6682321, built on July 15, 2020
Runtime version: 1.8.0_242-release-1644-b01 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
GC: ParNew, ConcurrentMarkSweep
Memory: 1237M
Cores: 24
Non-Bundled Plugins: org.jetbrains.kotlin
b

brandonmcansh

07/27/2020, 2:21 PM
interesting next question was gonna be the compiler arg to skip pre release checks but you have that too
Copy code
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
    kotlinOptions {
        jvmTarget = "1.8"
        freeCompilerArgs += ["-Xallow-jvm-ir-dependencies", "-Xskip-prerelease-check"]
    }
}
wondering if we need an updated compiler version
h

Horv

07/27/2020, 2:36 PM
Hmm, I didn't change anything (just fiddled back and forth with Kotlin-plugin settings etc) and now the Android Studio errors are gone. Still stuck on compiler error when trying to build though.
Or nevermind. Just doing any code change re-triggered the Android studio errors
b

brandonmcansh

07/27/2020, 2:57 PM
ah
f

Fudge

07/27/2020, 2:59 PM
Changing kotlin version in buildscript to 1.4.0-rc fixed it
❤️ 2
b

brandonmcansh

07/27/2020, 3:00 PM
ah nice find
h

Horv

07/27/2020, 3:30 PM
Ah, nice! Now I just need to find out how to debug my internal compilation error. 😕
a

allan.conda

07/27/2020, 9:21 PM
Changing kotlin version in buildscript to 1.4.0-rc fixed it
Awesome find, seems the problem occured due to this recent kotlin plugin update. Compose should probably update the instructions here: https://developer.android.com/jetpack/androidx/releases/compose
b

brandonmcansh

07/27/2020, 9:21 PM
+1
a

allan.conda

07/27/2020, 9:25 PM
probably should update coroutines as well to
1.3.8-1.4.0-rc