Which Kotlin metadata version is used in Android Kotlin Compiler

256 Views Asked by At

Problem

Android tools uses a custom version of Kotlin Compiler.

Is there a way to understand which version of Kotlin metadata this custom compiler uses?

Context

  1. Lints from Android-tools has a /android/tools/external/com-intellij/kotlin-compiler/ dependency with a specific Kotlin metadata somewhere under the hood.

  2. Your average Kotlin target uses a different version of Kotlin Compiler.

  3. As a result Kotlin update in your project, let's say 1.5.30 -> 1.6.0-M1 will lead to a problem:

    Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.4.0.
    
0

There are 0 best solutions below