Skc
11/08/2021, 11:16 PMext {
compose_version = '1.0.1'
kotlin_version = '1.5.21'
agp_version = '4.2.2'
}
dependencies {
classpath "com.android.tools.build:gradle:$agp_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
compose dependencies
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
implementation "androidx.compose.compiler:compiler:$compose_version"
implementation 'androidx.activity:activity-compose:1.3.1'
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
It fails while compiling saying
`this version (1.0.1) of the Compose Compiler requires Kotlin version 1.5.21 but you appear to be using Kotlin version 1.4.31 which is not known to be compatible. Please fix your configuration (or suppressKotlinVersionCompatibilityCheck
but don't say I didn't warn you!).`
Any hints where Kotlin 1.4.31
might be coming from?Skc
11/08/2021, 11:19 PMandroid {
compileSdkVersion 30
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
useIR = true
}
defaultConfig {
applicationId = "com.dummy.testapp"
minSdkVersion 21
targetSdkVersion 30
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
debug {
debuggable true
minifyEnabled false
shrinkResources false
}
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), '<http://sample-proguard-rules.pro|sample-proguard-rules.pro>'
}
}
flavorDimensions "default"
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion compose_version
}
packagingOptions {
resources {
excludes += '/META-INF/{AL2.0,LGPL2.1}'
}
}
}
Skc
11/08/2021, 11:22 PMSergio C.
11/08/2021, 11:55 PMSkc
11/09/2021, 12:06 AMSkc
11/09/2021, 12:18 AMSkc
11/09/2021, 12:19 AM> Task :sample:kaptGenerateStubsDemoDebugKotlin
Could not perform incremental compilation: Could not connect to Kotlin compile daemon
Could not connect to kotlin daemon. Using fallback strategy.
exception: java.io.EOFException
at java.io.ObjectInputStream$BlockDataInputStream.readByte(ObjectInputStream.java:3244)
at java.io.ObjectInputStream$BlockDataInputStream.readUTFChar(ObjectInputStream.java:3645)
at java.io.ObjectInputStream$BlockDataInputStream.readUTFBody(ObjectInputStream.java:3542)
at java.io.ObjectInputStream$BlockDataInputStream.readUTF(ObjectInputStream.java:3342)
at java.io.ObjectInputStream.readUTF(ObjectInputStream.java:1203)
at org.jetbrains.kotlin.utils.PluginUtilsKt.decodePluginOptions(pluginUtils.kt:39)
at org.jetbrains.kotlin.android.synthetic.AndroidCommandLineProcessor.processOption(AndroidComponentRegistrar.kt:91)
at org.jetbrains.kotlin.cli.jvm.plugins.PluginCliParserKt.processCompilerPluginsOptions(PluginCliParser.kt:125)
at org.jetbrains.kotlin.cli.jvm.plugins.PluginCliParser.processPluginOptions(PluginCliParser.kt:83)
at org.jetbrains.kotlin.cli.jvm.plugins.PluginCliParser.loadPlugins(PluginCliParser.kt:72)
at org.jetbrains.kotlin.cli.jvm.plugins.PluginCliParser.loadPluginsSafe(PluginCliParser.kt:44)
at org.jetbrains.kotlin.cli.common.CLICompiler.loadPlugins(CLICompiler.kt:179)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:69)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:52)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:88)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:44)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:98)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:76)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:45)
at org.jetbrains.kotlin.cli.common.CLITool$Companion.doMainNoExit(CLITool.kt:227)
at org.jetbrains.kotlin.cli.common.CLITool$Companion.doMainNoExit$default(CLITool.kt:222)
at org.jetbrains.kotlin.cli.common.CLITool$Companion.doMain(CLITool.kt:214)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler$Companion.main(K2JVMCompiler.kt:271)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.main(K2JVMCompiler.kt)
Frédéric Lemieux
11/09/2021, 4:58 AMext {
ext.kotlin_version = '1.5.31'
ext.compose_version = '1.1.0-beta02'
}
Frédéric Lemieux
11/09/2021, 4:58 AMbuildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion compose_version
}
Frédéric Lemieux
11/09/2021, 4:58 AMSkc
11/09/2021, 5:56 AMcompose true
and kotlinCompilerExtensionVersion compose_version
. Regarding the compatible versions, how did you find it? is it just trial and error because none of the config on official guide seem to work.Frédéric Lemieux
11/09/2021, 6:01 AMFrédéric Lemieux
11/09/2021, 6:01 AMSkc
11/09/2021, 10:07 PMtargetSdkVersion 31
🤔