Incompatible versions of Kotlin metadata - 1.5.1 expected
See original GitHub issueI’ve added the easylauncher
dependency in version 5.1.1
and Gradle sync returns following error:
com.project.starter/easylauncher/5.1.1/aa3307d8bfca4f9f3cb222f52c82095333094081/easylauncher-5.1.1.jar!/META-INF/easylauncher.kotlin_module:
Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.5.1.
I’m using the build-logic
pattern for Gradle, and my convention plugin for easylauncher
is pretty straightforward:
class EasylauncherConventionPlugin : Plugin<Project> {
override fun apply(target: Project) = with(target) {
pluginManager.apply("com.starter.easylauncher")
}
}
I’ve checked the dependency graph of my project with ./gradlew dependencies
but none of the deps I have include Kotlin versions below 1.6.20
. The complete list of other dependencies I’ve included:
[versions]
androidDesugarJdkLibs = "1.1.5"
androidGradlePlugin = "7.2.1"
androidxAppCompat = "1.4.2"
androidxCore = "1.8.0"
detekt = "1.20.0"
easylauncherGradlePlugin = "5.1.1"
junit4 = "4.13.2"
kotlin = "1.7.0"
kotlinterGradlePlugin = "3.10.0"
material3 = "1.6.1"
[libraries]
android-desugarJdkLibs = { group = "com.android.tools", name = "desugar_jdk_libs", version.ref = "androidDesugarJdkLibs" }
android-gradlePlugin = { group = "com.android.tools.build", name = "gradle", version.ref = "androidGradlePlugin" }
androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "androidxAppCompat" }
detekt-gradlePlugin = { group = "io.gitlab.arturbosch.detekt", name = "detekt-gradle-plugin", version.ref = "detekt" }
detekt-formatting = { group = "io.gitlab.arturbosch.detekt", name = "detekt-formatting", version.ref = "detekt" }
easylauncher-gradlePlugin = { group = "com.project.starter", name = "easylauncher", version.ref = "easylauncherGradlePlugin" }
junit4 = { group = "junit", name = "junit", version.ref = "junit4" }
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "androidxCore" }
kotlin-gradlePlugin = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin", version.ref = "kotlin" }
kotlinter-gradlePlugin = { group = "org.jmailen.gradle", name = "kotlinter-gradle", version.ref = "kotlinterGradlePlugin" }
material3 = { group = "com.google.android.material", name = "material", version.ref = "material3" }
I did some investigating but I failed to understand where the issue may come from. It is caused by adding the easylauncher
plugin, because removing the plugin dependency fixes Gradle sync problems, but I’m not able to locate it’s source. Any advice on how to approach this?
Issue Analytics
- State:
- Created a year ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
"Module was compiled with an incompatible version of Kotlin ...
"Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.16" ; 1....
Read more >Module was compiled with an incompatible version of Kotlin ...
Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.15. #2578.
Read more >[Solved] Module was compiled with an ... - Flutter Campus
kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15. e:...
Read more >Solutions to the problem "the binary version of its metadata is ...
kotlin_module : Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.5....
Read more >[Solved] Module was compiled with an ... - YouTube
Module was compiled with an incompatible version of Kotlin. Solve Kotlin version error.Error: Kotlin : Module was compiled with an ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m trying to implement the
build-logic
approach so I can easily share configurations between multiple app modules in a project. My goal is to create Convention Plugins for each commonly used dependency (ktlint, detekt, etc) so they can be easilly applied to modulesapp1
,app2
, etc.For a start, here’s my structure of
build-logic
module - it’s almost the same as in the sample I provided:Here’s the entire
build.gradle.kts
file frombuild-logic/convention
. I’ve removed references toeasylauncher
to make sure that this version works fine.also, in the root
myapp
directory, there’s abuild.gradle.kts
file defined like this:I can, but the
build-logic
module doesn’t seem to report anything withdependencies
command:But I’ve ran the same command in
build-logic/convention
and got this (posted as gist since it’s pretty long)Sorry that I’m not able to explain that in-depth - I’m not a gradle pro and I’m trying to figure out what the problem may be myself 😓
5.1.2 should be now available - I hope the workaround I pasted above will work for you 😃 If for some reason it does not - please let me know 👀