在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中添加邮箱和持卡人姓名?


当前回答

项目build.gradle:

ext.kotlin_version = '1.6.10'

应用程序/ build.gradle:

  dependencies {
   //  classpath 'com.android.tools.build:gradle:7.1.2'
   //  classpath "org.jetbrains.kotlin:kotlin-gradle- plugin:$kotlin_version"
   }

但是在ext.kotlin_version更改后,降低了这个警告,但红色警告消失了

其他回答

更改项目构建gradle为

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

    dependencies {
        classpath 'com.android.tools.build:gradle:7.2.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

另一个解决方案是降级androidx。Core: Core -ktx库到任何兼容版本。这个代码适用于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和minSdkVersion 19。

Gradle构建工具:com.android.tools.build: Gradle:3.3.1。

你需要什么来解决这个问题?

我从昨晚就开始面对这个问题。只是浏览一些网页无法得到确切的解决方案。我最终通过以下步骤解决了这个问题:

在构建中将ext.kotlin_version = '1.3.50'替换为ext.kotlin_version = '1.4.32'。gradle文件。 清理项目→用Gradle文件构建项目→运行

项目build.gradle:

ext.kotlin_version = '1.6.10'

应用程序/ build.gradle:

  dependencies {
   //  classpath 'com.android.tools.build:gradle:7.1.2'
   //  classpath "org.jetbrains.kotlin:kotlin-gradle- plugin:$kotlin_version"
   }

但是在ext.kotlin_version更改后,降低了这个警告,但红色警告消失了

我在IntelliJ IDEA的Maven项目中遇到过这个错误。 解决方案是关闭IntelliJ IDEA中的Kotlin插件,如果你的项目中没有使用Kotlin。

至:

菜单文件→设置→插件

点击复选框关闭Kotlin插件。在这里看到的: