29
votes

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.

6
Regarding the Kotlin build error, do either of these previous answers help? stackoverflow.com/a/67470309 stackoverflow.com/a/35170452 - Nolan H
HI @karthy - Did you find any solution?? - Srihari

6 Answers

90
votes

what solved my problem is changing this at build.gradle

from

ext.kotlin_version = '1.3.50'

to

ext.kotlin_version = '1.4.32'

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

8
votes

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

5
votes

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

1
votes

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.

0
votes

While I don't know how to specifically help with the build issues (though check the answer links I shared in comments above), for the name & email collection you would need to build UI for this.

You can add these billing_details (API) in the payment method create parameters (source) as seen in this Card element example, extended with optional values for name and email similar to this test.

0
votes

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.