Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

kotlinCompilerVersion is deprecated

I've just started a new Jetpack Compose project using the "Empty Compose Activity" Android Studio (2020.3.1 Canary 14) template, but I'm getting the following warning in my build.gradle.kts (:app) file:

'kotlinCompilerVersion: String?' is deprecated.

enter image description here

The deprecation does not provide any information about what to use instead. Should I simply remove this option or do something else?

like image 799
Duncan Luk Avatar asked Apr 08 '21 13:04

Duncan Luk


People also ask

Is jetpack compose stable now?

Today, we're releasing version 1.2 of Jetpack Compose, Android's modern, native UI toolkit, continuing to build out our roadmap.

What is the latest version of jetpack compose?

Today, we're releasing version 1.1 of Jetpack Compose, Android's modern, native UI toolkit, continuing to build out our roadmap. This release contains new features like improved focus handling, touch target sizing, ImageVector caching, and support for Android 12 stretch overscroll.

Is jetpack compose ready?

Is it production-ready? Googles launched Jetpack Compose 1.0. 0 and said: "It's stable, and ready for you to adopt in production."

What is new in compose?

Compose now supports the text magnifier. The magnifier is shown when dragging a selection handle to help you see what's under your finger. Compose 1.1. 0 brought the magnifier to selection within text fields, and now Compose 1.2.


1 Answers

kotlinCompilerVersion can be safely removed.
Compose now uses the kotlin compiler defined in your buildscript.

buildscript {
    ext.kotlin_version = '1.5.21'
    //....
    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

If you are using the plugins block (in settings.gradle or build.gradle)

pluginManagement {
    //..
    plugins {
        id 'org.jetbrains.kotlin.android' version '1.5.21' 
    }
}
like image 65
Gabriele Mariotti Avatar answered Oct 17 '22 04:10

Gabriele Mariotti