Mehdi Haghgoo
12/21/2020, 6:34 AMtasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs += ["-Xallow-jvm-ir-dependencies", "-Xskip-prerelease-check"]
}
gildor
12/21/2020, 6:40 AMMehdi Haghgoo
12/21/2020, 6:52 AMgildor
12/21/2020, 8:12 AMjim
12/21/2020, 4:53 PM1.8
target is probably because Android or R8 might choke if you use some JVM features from a higher language? Maybe the first flag -Xallow-jvm-ir-dependencies
is for when you have a project with multiple modules where a non-compose module depends upon a compose module; I think this first flag may become obsolete in 1.4.30
but I'm not sure if that has been 100% decided that it is now safe to remove the binary source check. The second flag (-Xskip-prerelease-check
) might already be obsolete since we are now on stable Kotlins; I think Compose was being built with pre-release versions of Kotlin at the time we started recommending that flag.
Basically, none of them would hurt you, and they might help you. Feel free to remove them at your own risk, but please don't complain build errors or IDE diagnostics you may encounter after having removed them.