Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
RoshanGupta256 opened this issue May 7, 2024 · 5 comments
Assignees

Comments

@RoshanGupta256
Copy link

I have added the package in my projects pubspec.yaml file and I am getting this error. I have tried flutter clean. and changed the kotlin version to the latest version too. Are there any other configuration required to use this package or am I making any mistakes?

@onevcat
Copy link
Member

onevcat commented May 13, 2024

@YkSix Seems to be a version mismatching in Kotlin/Java. Do you have any idea on this?

@YkSix
Copy link
Contributor

YkSix commented Jun 21, 2024

Hi @RoshanGupta256 ,
Thanks for reporting this issue.
I couldn't reproduce this issue even after I changed my app/build.gradle to be like:
(according to the current issue title)

compileOptions {
    sourceCompatibility = JavaVersion.VERSION_1_8
    targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
    jvmTarget = '17'
}

To better understand the root cause and background of this issue, could you please provide the following information:

  1. Has this issue been resolved on your end? If yes, how did you resolve this issue?
  2. These settings in your project
  • the gradle version (in file: gradle-wrapper.properties)
  • versions of sourceCompatibility, targetCompatibility and jvmTarget
  • the Kotlin version
  • the Android Gradle Plugin version (com.android.tools.build:gradle)

Thanks.

@RoshanGupta256
Copy link
Author

Hello @YkSix Thank You for response. I have added the required informations below.

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
    jvmTarget = '1.8'
}

sourceSets {
    main.java.srcDirs += 'src/main/kotlin'
}

defaultConfig {
    // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
    applicationId "com.example.eorder"
    // You can update the following values to match your application needs.
    // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
    minSdkVersion 24
    targetSdkVersion flutter.targetSdkVersion
    versionCode flutterVersionCode.toInteger()
    versionName flutterVersionName
}

signingConfigs {
    release {
       keyAlias keystoreProperties['keyAlias']
       keyPassword keystoreProperties['keyPassword']
       storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
       storePassword keystoreProperties['storePassword']
    }
}
buildTypes {
    release {
       signingConfig signingConfigs.release
    }
}

buildscript {
ext.kotlin_version = '1.9.23'

dependencies {
    classpath 'com.android.tools.build:gradle:7.3.0'
    classpath 'com.google.gms:google-services:4.3.15'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}

}

gradle.version=8.5

@YkSix
Copy link
Contributor

YkSix commented Jun 21, 2024

@RoshanGupta256 ,
Thanks for your reply.
I still couldn't reproduce the issue on my end. I created a sample app with the same configuration you mentioned. Could you please give it a try?

https://github.com/YkSix/flutter_line_sdk_mysample

Additionally, could you let me know which Java version you are using? Thanks.

$java --version
openjdk 17.0.9 2023-10-17
OpenJDK Runtime Environment GraalVM CE 17.0.9+9.1 (build 17.0.9+9-jvmci-23.0-b22)
OpenJDK 64-Bit Server VM GraalVM CE 17.0.9+9.1 (build 17.0.9+9-jvmci-23.0-b22, mixed mode, sharing)

@onevcat
Copy link
Member

onevcat commented Jun 26, 2024

As #103 merged and the new 2.3.8 release, I guess we can close this issue.

Please feel free to reopen it if there is still issues on building with the compatible versions.

@onevcat onevcat closed this as completed Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants