flutter_nfc_kit icon indicating copy to clipboard operation
flutter_nfc_kit copied to clipboard

Issue with JVM-target Compatibility After Updating flutter_nfc_kit

Open DanieleBocchino opened this issue 10 months ago • 1 comments

Hi,

I recently updated to the latest version of flutter_nfc_kit and encountered a build error related to JVM-target compatibility. The specific error message is as follows:

What went wrong:
Execution failed for task ':flutter_nfc_kit:compileDebugKotlin'.
> Inconsistent JVM-target compatibility detected for tasks 'compileDebugJavaWithJavac' (11) and 'compileDebugKotlin' (17).

This error suggests a discrepancy between the JVM target versions for Java and Kotlin compilation tasks within the flutter_nfc_kit plugin. Has anyone else encountered this issue, and if so, could you provide guidance on how to resolve it?

Thank you for your assistance.

DanieleBocchino avatar Apr 09 '24 15:04 DanieleBocchino

We have no Java code at all. This might be caused by your other dependencies that use Java 11. This problem looks similar to https://github.com/nfcim/flutter_nfc_kit/issues/154#issue-2208106367, but not caused by flutter_nfc_kit.

You should upgrade your Java to >= 17.0, Gradle to >= 8.0.0, AGP to >= 7.4.0. If the problem persists, check other dependencies and try to override there source level.

Harry-Chen avatar Apr 11 '24 08:04 Harry-Chen