Yingding Wang
04/03/2023, 6:35 PMJavaVersion.VERSION_11
, I am still using JavaVersion.VERSION_1_8
for most of my wear os apps. Is there any benefits or concerns i shall consider before switching?florent
04/03/2023, 6:40 PMYingding Wang
04/03/2023, 6:48 PMflorent
04/03/2023, 6:49 PMYingding Wang
04/03/2023, 6:50 PMYingding Wang
04/04/2023, 10:08 AMJavaVersion.VERSION_11
, I got a warning
> Task :wear:kaptGenerateStubsDebugKotlin
'compileDebugJavaWithJavac' task (current target is 11) and 'kaptGenerateStubsDebugKotlin' task (current target is 1.8) jvm target compatibility should be set to the same Java version.
I am not sure where is this kaptGenerateStubsDebugKotlin
task coming from.florent
04/04/2023, 10:14 AMYingding Wang
04/04/2023, 10:14 AMYingding Wang
04/04/2023, 10:32 AMkotlinOptions
is deprecated in groovy for gradle 7.5. The new syntax is:
kotlin {
jvmToolchain(11)
}
https://stackoverflow.com/questions/69079963/how-to-set-compilejava-task-11-and-compilekotlin-task-1-8-jvm-target-com/75395975#75395975florent
04/05/2023, 10:54 AMandroid {}
Yingding Wang
04/05/2023, 11:54 AMandroid { kotlinOptions { jvmTarget = "11"} }
doesn’t work for me with gradle 7.5 and kotlin 1.8.10 for some reason. I have to use the new syntax android { kotlin { jvmToolchain(11) } }
. And you are right, the kaptGenerateStudsDebugKotlin
task warning indicate that the kotlinOptions
for jvmTarget is not set properly.