uni-app UTS android dependencies 依赖后打包错误

uni-app UTS android dependencies 依赖后打包错误

开发环境 版本号 项目创建方式
Windows
Mac
Android 16 HBuilderX

操作步骤:

  • Class ‘com.stripe.android.PaymentConfiguration’ was compiled with an incompatible version of Kotlin. The binary version of its metadata is 2.0.0, expected version is 1.8.0.

预期结果:

  • 打包成功

实际结果:

  • 打包失败

bug描述:

  • Class ‘com.stripe.android.PaymentConfiguration’ was compiled with an incompatible version of Kotlin. The binary version of its metadata is 2.0.0, expected version is 1.8.0.

更多关于uni-app UTS android dependencies 依赖后打包错误的实战教程也可以访问 https://www.itying.com/category-93-b0.html

2 回复

已知问题,是因为目前kotlin版本较低导致。
这个问题会在近期发布的 4.81版本修复

更多关于uni-app UTS android dependencies 依赖后打包错误的实战教程也可以访问 https://www.itying.com/category-93-b0.html


这是一个典型的Kotlin版本兼容性问题。错误信息显示Stripe Android SDK使用了Kotlin 2.0.0的元数据版本,但你的项目环境期望的是1.8.0版本。

解决方案:

  1. 升级Kotlin版本:在项目的build.gradle文件中,将Kotlin版本更新至2.0.0或更高:
dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib:2.0.0"
}
  1. 检查Gradle插件兼容性:确保Android Gradle插件版本与Kotlin版本匹配。在项目级build.gradle中:
dependencies {
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:2.0.0"
}
回到顶部