svprdga / async_preferences

Flutter plugin to work with local preferences asynchronously.
Apache License 2.0
2 stars 3 forks source link

Inconsistent JVM-target compatibility #29

Closed Schefferbird closed 3 months ago

Schefferbird commented 3 months ago

I get the following error: Execution failed for task ':async_preferences:compileDebugKotlin'.

Inconsistent JVM-target compatibility detected for tasks 'compileDebugJavaWithJavac' (1.8) and 'compileDebugKotlin' (17).

compileOptions { // Sets Java compatibility to Java 17 sourceCompatibility JavaVersion.VERSION_17 targetCompatibility JavaVersion.VERSION_17 }

kotlinOptions {
    jvmTarget = '17'
}

I'm using Gradle 8.7-bin and android library and application 8.1.4. I solved it by changing it locally in the meantime.

Would be great if this could be adjusted for the next version. Also would be great with an upgrade for Gradle version.

I'm using this due to your excellent tutorial for ad consent :)

svprdga commented 3 months ago

Thanks for reporting the problem to me, and for watching my video!

I have a version in preparation, can you try it in your project to see if it fixes the bug? You can do this by modifying the way you import the plugin:

  async_preferences:
    git:
      url: git@github.com:svprdga/async_preferences.git
      ref: release/1.0.0

If you are still experiencing the error, it may be due to a specific configuration within your project. It would be helpful if you could provide me with a project where this error can be reproduced.

svprdga commented 3 months ago

@Schefferbird I can confirm that with version 1.0.0 of the plugin the error you mention disappears. You are now able to update your application to the latest version of gradle:

https://pub.dev/packages/async_preferences/versions/1.0.0

Schefferbird commented 3 months ago

Thanks David!

UsamaKarim commented 1 month ago

Getting error with version 1.0.0

Execution failed for task ':async_preferences:compileDebugKotlin'.
> Inconsistent JVM-target compatibility detected for tasks 'compileDebugJavaWithJavac' (1.8) and 'compileDebugKotlin' (17).

  Consider using JVM Toolchain: https://kotl.in/gradle/jvm/toolchain
  Learn more about JVM-target validation: https://kotl.in/gradle/jvm/target-validation 
UsamaKarim commented 1 month ago

Adding kotlin.jvm.target.validation.mode = IGNORE to gradle.properties worked