As I introduced Jetpack Compose and Room simultaneously for a new app, my Android Studio threw this error.
/***/***/.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.
When I wrote codes without Room libraries, I didn't get the error. Here is what I tried to solve this problem.
Upgrading Android Studio and Kotlin version
Referred this page: 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
However, I wasn't able to find "ext.kotlin_version = 'xxx'.", so I wrote this code in build.gradle, but wasn't able to solve it.
buildscript { ext { compose_version = '1.1.0-beta01' kotlin_version = '1.7.0' // add this line with '1.7.0' and '1.7.1' } }
Referred another page: https://github.com/square/kotlinpoet/issues/1303
How should I do next to deal with this problem?