Richard Onslow Roper
Richard Onslow Roper

Reputation: 6835

Where to specify Kotlin Version for Compose as of Compose 1.0.1?

The use of kotlinCompilerVersions in composeOptions was deprecated, after which compose just used the kotlin version defined in the project level build file. Now, even that seems to be deprecated, since as of compose 1.0.1, there is no kotlin version specified in the buildScript. How to update it now? In fact, 'where' to? I am unable to build project.

This is all there is in my project-level build

task clean(type: Delete) {
    delete rootProject.buildDir
}

buildscript {
    ext {
        compose_version = '1.0.1'
    }
}

As is clear, there IS no kotlin version defined anywhere (the same is true for the app level build), but it is clear that the version IS being picked up from somewhere, leading to the compiler error. That is what I want to know - From where the version is being picked up, and if, and how I can modify the same.

I am getting this error currently

e: This version (1.0.1) of the Compose Compiler requires Kotlin version 1.5.21 but you appear to be using Kotlin version 1.5.10 which is not known to be compatible.  Please fix your configuration (or `suppressKotlinVersionCompatibilityCheck` but don't say I didn't warn you!).

Well, I do not want to suppress the warning. If there's another solution, I'd appreciate your help

Thanks!

Upvotes: 1

Views: 1917

Answers (1)

Richard Onslow Roper
Richard Onslow Roper

Reputation: 6835

Finally found where it is. There's a file named settings.gradle(Project). The version was pre-defined in the plugins block

Here it is

pluginManagement {
    repositories {
        gradlePluginPortal()
        google()
        mavenCentral()
    }
    plugins {
        id 'com.android.application' version '7.1.0-alpha06'
        id 'com.android.library' version '7.1.0-alpha06'
        id 'org.jetbrains.kotlin.android' version '1.5.10' // Right here 
    }
}
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
    }
}
rootProject.name = "OrgFarm"
include ':app'

Upvotes: 3

Related Questions