I'm trying to remove the deprecated `kotlinCompile...
# compose
a
I'm trying to remove the deprecated
kotlinCompilerVersion
setting from my app module's
build.gradle
file, but I'm getting the following error:
This version (1.0.0-beta05) of the Compose Compiler requires Kotlin version 1.4.32 but you appear to be using Kotlin version 1.4.31 which is not known to be compatible.
I'm using Kotlin
1.4.32
actually and AS Arctic Fox
2020.3.1 Beta 3
. If I keep the setting then the project compiles just fine. Would could be the issue?
The root
build.gradle
:
Copy code
buildscript {
    ext {
        decompose_version = '0.2.4'
        kotlin_version = "1.4.32"
        compose_version = '1.0.0-beta05'
        androidx_appcompat_version = '1.3.0'
        androidx_core_ktx_version = '1.3.2'
        android_material_version = '1.3.0'
        androidx_lifecycle_common_java8_version = '2.3.1'
        androidx_activity_version = '1.3.0-alpha05'
        androidx_activity_compose_version = '1.3.0-alpha05'
        android_material_version = '1.3.0'
    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.2.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}
The app's `build.gradle`:
Copy code
plugins {
    id "com.android.application"
    id "kotlin-android"
}

android {
    compileSdkVersion 30
    buildToolsVersion "30.0.3"

    defaultConfig {
        minSdkVersion 21
        targetSdkVersion 30
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    kotlinOptions {
        jvmTarget = '1.8'
    }

    buildFeatures {
        compose true
    }

    composeOptions {
        kotlinCompilerExtensionVersion compose_version
//        kotlinCompilerVersion kotlin_version
    }
}

dependencies {
    implementation project(":shared")
    implementation "androidx.appcompat:appcompat:$androidx_appcompat_version"
    implementation "com.google.android.material:material:$android_material_version"
    implementation "androidx.compose.ui:ui:$compose_version"
    implementation "androidx.compose.ui:ui-tooling:$compose_version"
    implementation "androidx.compose.foundation:foundation:$compose_version"
    implementation "androidx.compose.material:material:$compose_version"
    implementation "androidx.compose.material:material-icons-core:$compose_version"
    implementation "androidx.activity:activity-compose:$androidx_activity_compose_version"
}
c
Didn't know it was deprecated! Need a lint check for it. 😄 Thanks.
j
updating to beta08 and 1.5.10 doesn't solve the problem?
a
@Colton Idle I actually read your message 🙂 https://kotlinlang.slack.com/archives/CJLTWPH7S/p1614672032411500
c
Hahaha. How times flies. I somehow have no recollection that I sent that here.
a
@Javier I don't want to update at the moment, just want to check why it does not work. I'm trying to follow the setup guide: https://developer.android.com/jetpack/compose/setup Tried
beta07
just out of curiosity, still the error.
j
I tried with 08 via jb plugin + androidx snapshot and I was not setting that property
Not sure about removing it in previous versions TBH
c
@jim going off of the /setup link above... are any of these needed anymore?
Copy code
kotlinOptions {
        jvmTarget = "1.8"
        useIR = true
    }

    composeOptions {
        kotlinCompilerVersion = "1.4.32"
        kotlinCompilerExtensionVersion = "1.0.0-beta07"
    }
a
The setup guide mentions
beta07
, so I assume it should work? Unless I'm missing something. I'm using pure Jetpack Compose for Android currently.
j
the setup guide indicates different setups if you are using groovy vs kotlin, kotlin one still uses it, so maybe groovy one is wrong
a
Didn't notice the difference, thanks! I'm using Groovy at the moment, so I'm looking at the Groovy tab. I will keep the setting for now. Just want to confirm whether it is a bug or I'm doing something wrong, or maybe the doc is inaccurate. If it is a bug, I can file a ticket with a reproducer.
x
saw the same - it seems to use
kotlinCompilerVersion
even when deprecated.
ComposeOptions.kotlinCompilerVersion is deprecated. Compose now uses the kotlin compiler defined in your buildscript.
i dont trust this 🤔
d
we have same error in a kmm project. our first try to integrate compose
235 Views