Build is successful but running fails. On running on an android phone, this is the error:
'compileDebugJavaWithJavac' task (current target is 1.8) and 'compileDebugKotlin' task (current target is 17) jvm target compatibility should be set to the same Java version.
Consider using JVM toolchain: https://kotl.in/gradle/jvm/toolchain
I've already included the JVM toolchain by adding the following in my android/app/build.gradle.kts:
{
...
kotlin {
jvmToolchain(17)
}
...
}
I am using gradle version 8.13 and AGP version 8.9.1, running on android 35. Android studio ships the latest kotlin version with it by default.
What could be the issue and how can I resolve it?