[Android] Plugin fails to build due to unpinned Kotlin jvmTarget
OpenSrcerer opened this issue · 1 comments
OpenSrcerer commented
I am using Capacitor with Quasar.
This plugin fails to build because of a version mismatch between the Kotlin and Java tasks. In the build.gradle
file currently only the Java version is fixed. Since the Kotlin jvmTarget
is not defined, the JDK's version is chosen (in my case, 19) causing a conflict and not allowing the plugin to build (see logs below).
The fix to this this problem would be to also pin the Kotlin version. That can easily be done:
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = 17
}
Logs:
> Task :capacitor-community-bluetooth-le:compileReleaseKotlin FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':capacitor-community-bluetooth-le:compileReleaseKotlin'.
> 'compileReleaseJavaWithJavac' task (current target is 17) and 'compileReleaseKotlin' task (current target is 19) jvm target compatibility should be set to the same Java version.
Plugin version:
- @capacitor-community/bluetooth-le: 3.1.1
Desktop (please complete the following information):
- OS:
Pop!_OS jammy 22.04 x86_64
- Java Version:
19.0.2 2023-01-17