The reason why this error occurs is that “the binary version of its metadata is 1.7.1, but the intended version is 1.5.1.“
It’s possible that this error was thrown by Android Studio since you concurrently added Jetpack Compose and Room for a new app.
/***/***/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.7.0/51736992f422993a1e741051bdf3c12801bc1ca1/kotlin-stdlib-common-1.7.0.jar!/META-INF/kotlin-stdlib-common.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.
You did not encounter the error when you developed codes that did not make use of Room libraries. Here are some potential solutions to this issue that you could attempt.
- Upgrading Android Studio and the Kotlin version
- This page has been referred to: This module was compiled using a version of Kotlin that is not compatible. 1.5.1 is the binary version of its metadata, while 1.1.15 is the version that is intended.
However, you wil unable to locate “ext.kotlin version = ‘xxx’.,” so you can write this code in build. gradle.
It is recommended that you upgrade Kotlin to version 1.7.10 and compose to version 1.3.0. If it does not work, try using compose version 1.2.0 and kotlin version 1.7.0.
|Compose Compiler Version||Compatible Compiler Version|
Also ensure that the same variable is used for the Kotlin Gradle Plugin in the build.gradle file of the project.
classpath “org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin version”
We sincerely hope that going through our method to fix this problem was enjoyable for you. We are confident that you will be able to address the problem with the message that says your “the binary version of its metadata is 1.7.1, expected version is 1.5.1” as a result of the information that has been provided.
The system’s overall position will also improve as a result of this change, in addition to the fact that it will provide adequate error handling. The first thing that needs to be done in order to make a system more secure is to identify the error handlers that are currently being employed and then switch them out for techniques that are safer.
You may be interested in: Beginner’s Guide to Trading Binary Options