144

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.

Karthy Sbk
  • 1,553
  • 2
  • 5
  • 7
  • 1
    Regarding the Kotlin build error, do either of these previous answers help? https://stackoverflow.com/a/67470309 https://stackoverflow.com/a/35170452 – Nolan H May 26 '21 at 13:17
  • Does this answer your question? ["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"](https://stackoverflow.com/questions/67448034/module-was-compiled-with-an-incompatible-version-of-kotlin-the-binary-version) – Troy May 21 '22 at 15:32

12 Answers12

362

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

Mohamed Arafa
  • 3,708
  • 1
  • 5
  • 12
27

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

19

Firstly, go to settings, and then navigate to plugins. Find the kotlin plugin and update it.

Next, In gradle files, go to build.gradle (Project: YourApp). Then, change the following code (in buildscript) from:

ext.kotlin_version = '1.3.50'

to the latest version, such as:

ext.kotlin_version = '1.4.32'

To know the latest version, go to settings and the plugins, find kotlin plugin, and make sure it is updated. The latest version is under Jetbrains.

After following the instructions, your error will be resolved.

Yousuf
  • 386
  • 1
  • 7
  • My current project is very old. And exactly 1.4.32 version allowed me solve the issue. Updating to newer versions produce some problems. – antaki93 May 25 '22 at 12:22
  • Better, see what they recommend here: https://docs.flutter.dev/release/breaking-changes/kotlin-version. – Daniel Porteous May 29 '22 at 02:17
16

Make sure that the Kotlin version of your IDE is the same as the version declared in your gradle.build file.

user14604774
  • 161
  • 2
16

Had this problem in Flutter project

in my case line for kotlin-gradle-plugin was missing in android build.gradle, so adding ext.kotlin_version = '1.6.10' didnt not fix it.

After adding

classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

error was gone.

Full code section:

buildscript {
    ext.kotlin_version = '1.6.10'
    repositories {
        google()
        mavenCentral()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:4.1.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}
kashlo
  • 1,438
  • 1
  • 20
  • 34
12

✔️ Fixed by updating kotlin gradle plugin version.

In project level build.gradle file, update the following line.

ext.kotlin_version = '1.6.10'

You can find the latest kotlin gradle plugin version here https://kotlinlang.org/docs/gradle.html

UdaraWanasinghe
  • 1,882
  • 2
  • 16
  • 20
9

Question: What you need to do to solve this?

Answer: I was facing this issue since last night. Just navigate through some webpages couldn't get to the exact solution finally solved it by these steps, Replace ext.kotlin_version = '1.3.50' to ext.kotlin_version = '1.4.32' in build.gradle file. Clean project -> Build the project with gradle files -> Run

2

I have face this error in Intellij Idea with Maven project. The solution is about to turn off Kotlin plugin in Intellij Idea if you are not using Kotlin in your project.

Go To:

File > Settings > Plugins

and turn off kotlin plugin by click on check box. See here enter image description here

Muzzamil
  • 2,665
  • 2
  • 8
  • 22
1

Another solution is to downgrade androidx.core:core-ktx library to any compatible version, this one worked for kotlin_version = '1.3.31':

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.appcompat:appcompat:1.3.1'  // The only working for this version (sdk/gradle)
    implementation 'androidx.core:core-ktx:1.0.2' // The only working for this version (sdk/gradle)
    implementation 'androidx.constraintlayout:constraintlayout:1.1.2' // higher versions require min-sdk >= 26
    ...
}

Android SDK: compileSdkVersion 30 and minSdkVersion 19.

Gradle build Tool: com.android.tools.build:gradle:3.3.1.

Ibrahim.H
  • 822
  • 1
  • 11
  • 18
1

Most of the answers here seem to revolve around projects that use Gradle.

I randomly encountered this problem in IntelliJ that that was compiling and running a Maven project just fine 5 minutes before - no config changes. Introduced a new exception class and this problem popped up.

I tried invalidating caches and restarting, which didn't resolve the issue - however, disabling and re-enabling the Kotlin plugin resolved the issue.

Hopefully this can help someone who encounters this issue using Maven.

VoidBeans
  • 11
  • 3
1

Using Flutter, Fixed by:

  • Updating Android Studio packages, specially Kotlin plugin.

  • Get the last Kotlin plugin version Nbr from Gradle - Plugin and versions, for now it's 1.6.10.

  • Update <Your_project_name_folder>\android\build.gradle file by replacing the old kotlin version by the new one you got from the web site above.

    ext.kotlin_version = '<The_new_version_Nbr>' in my case ext.kotlin_version = '1.6.10'

  • Restart VS Code.

You're Done.

silver daymon
  • 81
  • 1
  • 4
0

In my case, the solution was:

  • Updating Android Studio packages, specially Kotlin plugin.

    Get the last Kotlin plugin version number from Gradle - Plugin and versions. For me it's 1.6.10. You can get the last version here: https://plugins.jetbrains.com/plugin/6954-kotlin

  • Update <Your_project_name_folder>/android/build.gradle file by replacing the old kotlin version by the new one you got from the web site above. In my case ext.kotlin_version = '1.6.10'

  • Update the file <Your_project_name_folder>/android/gradle/wrapper/gradle-wapper.properties

    Change the version of the distributionUrl properti:

    from https://services.gradle.org/distributions/gradle-5.6.2-all.zip

    to https://services.gradle.org/distributions/gradle-6.9-all.zip

    To see about this last point: https://stackoverflow.com/a/67470309/15330197