kotlin gradle插件的Flutter问题:其元数据的二进制版本是1.8.0,预期版本是1.6.0

问题描述 投票:0回答:1

我已经根据提供的文档在我的 Flutter 应用程序中成功设置了 WalletConnect 和 Web3Modal。在调试模式(flutter run)下运行应用程序时,集成工作得很好,但在尝试使用 flutter build apk 构建 APK 时遇到问题。

我收到的错误消息是“kotlin gradle 插件”,如下:

e: C:/Users/DELL/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.8.22/636bf8b320e7627482771bbac9ed7246773c02bd/kotlin-stdlib-1.8.22.jar!/META-INF/kotlin-stdlib-jdk8.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: C:/Users/DELL/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.8.22/1a8e3601703ae14bb58757ea6b2d8e8e5935a586/kotlin-stdlib-common-1.8.22.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.8.0, expected version is 1.6.0.

我尝试通过调整settings.gradle中的设置来解决此问题:

plugins {
    id "dev.flutter.flutter-plugin-loader" version "1.0.0"
    id "com.android.application" version "7.3.0" apply false
    // from  id "org.jetbrains.kotlin.android" version "1.7.10" apply false to  id "org.jetbrains.kotlin.android" version "1.8.10" apply false
    id "org.jetbrains.kotlin.android" version "1.8.10" apply false
}

我将 org.jetbrains.kotlin.android 的版本从 1.7.10 更改为 1.8.10,但不幸的是,此调整并没有解决问题并给出:

e: D:/file/flutter-login/flutter_meta/meta_votes/build/coinbase_wallet_sdk/.transforms/7a744c75ca253dc3492a7d97df04dbf8/transformed/out/jars/classes.jar!/META-INF/coinbase_wallet_sdk_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: D:/file/flutter-login/flutter_meta/meta_votes/build/package_info_plus/.transforms/aa087afe4aa803c0095dfc56258fae7d/transformed/out/jars/classes.jar!/META-INF/package_info_plus_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version 
is 1.6.0.
e: D:/file/flutter-login/flutter_meta/meta_votes/build/appcheck/.transforms/818cdf2464331e05845fdc9f1bf59bb0/transformed/out/jars/classes.jar!/META-INF/appcheck_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: C:/Users/DELL/.gradle/caches/transforms-3/d30e2ff50d26b8df2835e11ad1292c14/transformed/core-1.10.1/jars/classes.jar!/META-INF/core_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: C:/Users/DELL/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.8.22/636bf8b320e7627482771bbac9ed7246773c02bd/kotlin-stdlib-1.8.22.jar!/META-INF/kotlin-stdlib-jdk7.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: C:/Users/DELL/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.8.22/636bf8b320e7627482771bbac9ed7246773c02bd/kotlin-stdlib-1.8.22.jar!/META-INF/kotlin-stdlib.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 
1.6.0.
e: C:/Users/DELL/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.8.22/636bf8b320e7627482771bbac9ed7246773c02bd/kotlin-stdlib-1.8.22.jar!/META-INF/kotlin-stdlib-jdk8.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: C:/Users/DELL/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.8.22/1a8e3601703ae14bb58757ea6b2d8e8e5935a586/kotlin-stdlib-common-1.8.22.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.8.0, expected version is 1.6.0.

任何人都可以提供有关如何解决此兼容性问题并使用 WalletConnect/Web3ModalFlutter 成功为我的 Flutter 应用程序生成 APK 的指导吗?

android flutter apk flutter-dependencies web3modal
1个回答
0
投票

请更改 build.gradle 文件中的 kotlin ext 版本

buildscript {
ext.kotlin_version = '1.8.10'

app/build.gradle 中的插件可以保留:

plugins {
  id "com.android.application"
  id "kotlin-android"
  id "dev.flutter.flutter-gradle-plugin"
}
© www.soinside.com 2019 - 2024. All rights reserved.