在Stripe中,我的客户需要电子邮件和持卡人的姓名,但Stripe支付UI没有在com.stripe.android.view.CardMultilineWidget中提供该选项。我想试试最新的条纹版,

I was using Stripe version (14.1.1). So I updated it to the latest one (16.8.0) The build showed me the error that it doesn't take minSdkVersion 19. It requires 21 in manifest merger. So I updated minSdkVersion to 21. 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.

我尝试改变Gradle版本,但我仍然得到相同的错误。如何解决不兼容的错误,在Stripe中添加邮箱和持卡人姓名?


当前回答

首先,进入设置,然后导航到插件。找到Kotlin插件并更新它。

接下来,在gradle文件中,去构建。gradle(项目:YourApp)。然后,更改以下代码(在buildscript中):

ext.kotlin_version = '1.3.50'

到最新版本,如:

ext.kotlin_version = '1.4.32'

要了解最新版本,请转到设置和插件,找到Kotlin插件,并确保它已更新。最新版本是在JetBrains名下。

按照说明操作后,您的错误将得到解决。

其他回答

在我的案例中

其元数据的二进制版本为1.7.1,预期版本为1.5.1

得到build.gradle(project)中的(dependencies)从1.5转换。X (X)在这里是(20)

classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.20"

对1.7.10

 classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10"

如果您在Flutter for Android构建中遇到此错误,请尝试将Kotlin版本更改为

Ext.kotlin_version = '1.4.32'

我在Flutter项目中遇到过这个问题。

在我的例子中,Android版本中缺少kotlin-gradle-plugin的一行。所以添加ext.kotlin_version = '1.6.10'并不能修复它。

后添加

classpath “org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version”

错误消失了。

完整代码部分:

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"
    }
}

通过更新Kotlin Gradle插件版本修复了这个问题。

在项目级构建中。Gradle文件,更新下面的行。

ext.kotlin_version = '1.6.10'

你可以在这里找到最新的Kotlin Gradle插件版本 工具/构建工具/ Gradle。

在文件构建中更改此。Gradle解决了我的问题。

From

ext.kotlin_version = '1.3.50'

to

ext.kotlin_version = '1.6.0'

或者任何最新版本的Kotlin可用,并确保在Android Studio上更新Kotlin版本。