k

    KamilH

    2 years ago
    Does anyone else sees the following problem in 0.1.0-dev16:
    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

    2 years ago
    update your kotlin version to 1.4.0-rc
    k

    KamilH

    2 years ago
    I’m currently using
    1.4.0-rc
    and newest Kotlin Plugin
    a

    allan.conda

    2 years ago
    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
    jim

    jim

    2 years ago
    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

    2 years ago
    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
    Zach Klippenstein (he/him) [MOD]

    Zach Klippenstein (he/him) [MOD]

    2 years ago
    @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?
    jim

    jim

    2 years ago
    The later, avoiding experimental dependencies.