My application written in flutter language gives the following error:
e: C:/Users/Mert/Desktop/isg_yeni/isg/build/sensors_plus/.transforms/850bf5b7a09199329b383f74fe33a0fc/transformed/out/jars/classes.jar!/META-INF/sensors_plus_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.6.0.
e: C:/Users/Mert/Desktop/isg_yeni/isg/build/share_plus/.transforms/738a704c1196ddd6d9f00fc45e444923/transformed/out/jars/classes.jar!/META-INF/share_plus_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.6.0.
e: C:/Users/Mert/.gradle/caches/transforms-3/ed354497fa2c673eab69beae667a9b99/transformed/jetified-activity-1.7.2/jars/classes.jar!/META-INF/activity_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: C:/Users/Mert/.gradle/caches/transforms-3/40e78fa6fa60bb3dcae93e8b1ce197e9/transformed/lifecycle-livedata-2.6.1/jars/classes.jar!/META-INF/lifecycle-livedata_release.kotlin_module: Module was compiled with an incompatible version of
Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: C:/Users/Mert/.gradle/caches/transforms-3/77a0c98133178853d799635ee4a20e81/transformed/lifecycle-viewmodel-2.6.1/jars/classes.jar!/META-INF/lifecycle-viewmodel_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: C:/Users/Mert/.gradle/caches/transforms-3/d6680c3721692dc4a9fb42dbecaa2262/transformed/lifecycle-livedata-core-2.6.1/jars/classes.jar!/META-INF/lifecycle-livedata-core_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: C:/Users/Mert/.gradle/caches/transforms-3/8ae031f1d0da2125f68c17d76f9088e5/transformed/jetified-lifecycle-viewmodel-savedstate-2.6.1/jars/classes.jar!/META-INF/lifecycle-viewmodel-savedstate_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: C:/Users/Mert/.gradle/caches/transforms-3/fb73caa49f1892fee8d409818e83296f/transformed/jetified-core-ktx-1.10.1/jars/classes.jar!/META-INF/core-ktx_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: C:/Users/Mert/.gradle/caches/transforms-3/f2c1b21e2617b8adc4232d8977a76481/transformed/core-1.10.1/jars/classes.jar!/META-INF/core_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version
of its metadata is 1.8.0, expected version is 1.6.0.
e: C:/Users/Mert/.gradle/caches/transforms-3/ca5afb2fabe5b1e390fd5c06c8f1bc5d/transformed/lifecycle-runtime-2.6.1/jars/classes.jar!/META-INF/lifecycle-runtime_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: C:/Users/Mert/.gradle/caches/modules-2/files-2.1/androidx.lifecycle/lifecycle-common/2.6.1/10f354fdb64868baecd67128560c5a0d6312c495/lifecycle-common-2.6.1.jar!/META-INF/lifecycle-common.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: C:/Users/Mert/.gradle/caches/transforms-3/f62a687ef6392077f061d3a97cabe81c/transformed/jetified-savedstate-1.2.1/jars/classes.jar!/META-INF/savedstate_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: C:/Users/Mert/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.9.20/e58b4816ac517e9cc5df1db051120c63d4cde669/kotlin-stdlib-1.9.20.jar!/META-INF/kotlin-stdlib.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.6.0.
e: C:/Users/Mert/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.9.20/e58b4816ac517e9cc5df1db051120c63d4cde669/kotlin-stdlib-1.9.20.jar!/META-INF/kotlin-stdlib-jdk8.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.6.0.
e: C:/Users/Mert/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.9.20/e58b4816ac517e9cc5df1db051120c63d4cde669/kotlin-stdlib-1.9.20.jar!/META-INF/kotlin-stdlib-jdk7.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.6.0.
This error appeared when I ran flutter build apk –release
2
Answers
I did what you said and then it gave me this error: FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
2: Task failed with an exception.
BU�LD FAILED in 1s
It’s hard to say exactly what’s wrong because you didn’t provide a minimal, reproducible example, but I think this has a chance to solve your problem (by looking at the error messages you’re getting):
In
android/build.gradle
, setext.kotlin_version = '1.9.0'
.Also, make sure that you’re using the latest versions of all Flutter packages/plugin in
pubspec.yaml
. If you added native Android dependencies, also make sure to update their to latest stable versions (inandroid/app/build.gradle
).In general, I recommend you always use latest dependencies:
android/build.gradle
, setext.kotlin_version = '1.9.20'
(see latest Kotlin versions here)android/app/build.gradle
, setclasspath 'com.android.tools.build:gradle:7.4.2'
(or8.1.2
, if you wish to use the latest-latest one) (see latest Android Gradle Plugin versions here)android/gradle/wrapper/gradle-wrapper.properties
, setdistributionUrl=https://services.gradle.org/distributions/gradle-8.4-all.zip
(see latest Gradle versions here)