-
Notifications
You must be signed in to change notification settings - Fork 283
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
Inconsistent JVM-target compatibility detected for tasks 'compileDebugJavaWithJavac' (1.8) and 'compileDebugKotlin' (17). #255
Comments
After further research it turns out that the error appears useing kotlin >=1.8.0 but as my app uses com.google.gms.google-services which is compiled with a newer version of kotlin, it ends up with: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1 So, could you please update the plugin with a new version of kotlin in the build.gradle file with at least ext.kotlin_version = '1.7.10'? |
Encountering the same issue in my project. Seems like this PR should solve this, but there has been no action since October 😬 |
@tomcatvr check out this comment, seems to be working as a workaround for me at the moment! |
@adigladi Thanks very much, it worked! |
This looks totally different than what I use (flutter/flutter#125181 (comment)) This is the error I get FAILURE: Build failed with an exception.
Consider using JVM Toolchain: https://kotl.in/gradle/jvm/toolchain
BUILD FAILED in 5m 12s settings.gradle pluginManagement {
} plugins { include ":app" android\build.gradle buildscript {
// 7_2_0
// classpath 'com.google.gms:google-services:4.3.15'
} allprojects { rootProject.buildDir = '../build' tasks.register("clean", Delete) { app\build.gradle plugins { def localProperties = new Properties() def flutterVersionCode = localProperties.getProperty('flutter.versionCode') def flutterVersionName = localProperties.getProperty('flutter.versionName') //apply plugin: 'com.android.application' android {
// minSdkVersion flutter.minSdkVersion
// storeFile file('H:\FlutterPlaystore\app\key.jks')
// signingConfig signingConfigs.release
} flutter { dependencies { // implementation 'com.android.support:multidex:1.0.3'
// implementation platform('com.google.firebase:firebase-bom:31.1.1') } gradle-wrapper.properties distributionBase=GRADLE_USER_HOME
|
@Megatronicus have you found any solution to your problem? I am encountering the same issue and I have been stuck on this for a week, I need help. |
try upgrade - id "org.jetbrains.kotlin.android" version "1.7.10" apply false
+ id "org.jetbrains.kotlin.android" version "1.9.24" apply false |
This is what fixed it for me. I recognise that this is probably a hack, covering up the real issue, but maybe it'll get you out of Java Jail: Top level allprojects {
repositories {
google()
mavenCentral()
}
// Added this block:
afterEvaluate { project ->
if (project.hasProperty("kotlin")) {
project.tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = "1.8"
}
}
}
}
} |
this works for me
|
Hi, Where did you placed kotlin, inside android or outside?
|
here, is the full code. `plugins { android {
} flutter { dependencies { |
Hi, after upgrading to the latest flutter plugin I get this error on compiling the module
Here is my build.gradle config
...
android {
compileSdkVersion 34
ndkVersion flutter.ndkVersion
...
The complete error is
Execution failed for task ':video_compress:compileDebugKotlin'.
Dart plugin: 231.9411
Flutter plugin: 77.2.1
Flutter version 3.13.9
Dart version 3.1.5
Thanks
Carlo
The text was updated successfully, but these errors were encountered: