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

In stripe, my client wants email and card holder name, but stripe payment UI doesn't provide that option in com.stripe.android.view.CardMultilineWidget. I wanted to give a try with latest stripe version,

  1. I was using stripe version(14.1.1). so updated it to latest one(16.8.0)

  2. Build showed me the error that it don't take minSdkVersion 19. requires 21 in manifest merger. So i updated minSdkVersion to 21

  3. I got caches/transforms-2/files-2.1/4541b0189187e0017d23bbb0afebd16a/jetified-kotlin-stdlib-common-1.5.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.5.1, expected version is 1.1.15.

I tired changing gradle version. still getting the same error. Need some help out there to solve the incompatible error & add email and card holder name in stripe. Thanks.


Solution 1:

what solved my problem is changing this at build.gradle

from

ext.kotlin_version = '1.3.50'

to

ext.kotlin_version = '1.6.0'

or what ever the latest version of Kotlin available and make sure to update Kotlin version on Android Studio as well

Solution 2:

If you are facing this Error in Flutter build for Android the try to change the Kotlin version to

ext.kotlin_version = '1.4.32'

enter image description here