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

KamilH

08/11/2020, 8:41 AM
Does anyone else sees the following problem in `0.1.0-dev16`:
Copy code
Class 'androidx.compose.runtime.Composable' is compiled by a new Kotlin compiler backend and cannot be loaded by the old compiler
I can see this even though app is compiling and running on my device
a

allan.conda

08/11/2020, 9:01 AM
update your kotlin version to 1.4.0-rc
k

KamilH

08/11/2020, 9:48 AM
I’m currently using
1.4.0-rc
and newest Kotlin Plugin
a

allan.conda

08/11/2020, 9:52 AM
hmm make sure everything is updated. I had the same problem before but updating fixed the problem. doublecheck
kotlinCompilerVersion
,
kotlinCompilerExtensionVersion
,
kotlin-stdlib
and
kotlin-gradle-plugin
👍 1
j

jim

08/11/2020, 10:08 AM
Probably you're missing the -Xallow-jvm-ir-dependencies as per the "declaring dependencies" section of the release notes: https://developer.android.com/jetpack/androidx/releases/compose#declaring_dependencies
k

KamilH

08/11/2020, 11:05 AM
Thank you, this was it. I have multimodule project and I added
-Xallow-jvm-ir-dependencies
stuff in the project level
gradle
file before. It turn out I had to do it in the module I’m using Compose
z

Zach Klippenstein (he/him) [MOD]

08/11/2020, 4:03 PM
@jim what does that flag actually do? Does the IR backend generate different bytecode that the compiler has to be notified about so it can interact correctly or something? Or is it just a warning to prevent accidentally including experimental dependencies?
j

jim

08/11/2020, 4:04 PM
The later, avoiding experimental dependencies.
👍 1