capacitor-community / bluetooth-le

Capacitor plugin for Bluetooth Low Energy
MIT License
274 stars 79 forks source link

[Android] Plugin fails to build due to unpinned Kotlin jvmTarget #621

Closed OpenSrcerer closed 6 months ago

OpenSrcerer commented 6 months ago

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:

Desktop (please complete the following information):

pwespi commented 6 months ago

closed by #622