ResourceUtils.kt: (88, 15): Class ‘kotlin.Unit‘ was compiled with an incompatible version of Kotlin.

┌─ Flutter Fix ──────────────────────────────────────────────────────────────────────────────┐
│ [!] Your project requires a newer version of the Kotlin Gradle plugin.                     │
│ Find the latest version on https://kotlinlang.org/docs/releases.html#release-details, then │
│ update /Users/a1234/Desktop/test0717/ttt/android/build.gradle:                             │
│ ext.kotlin_version = '<latest-version>'                                                    │
└────────────────────────────────────────────────────────────────────────────────────────────┘

flutter开发爬坑记录:

e: /Users/a1234/.pub-cache/hosted/pub.dev/nordic_dfu-6.1.4+hotfix/android/src/main/kotlin/dev/steenbakker/nordicdfu/ResourceUtils.kt: (71, 21): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
The class is loaded from /Users/a1234/.gradle/caches/transforms-3/fcc4b519de205b6648feccd3aff6677d/transformed/jetified-kotlin-stdlib-1.9.23.jar!/kotlin/Unit.class

核心问题就就是:这句话:The binary version of its metadata is 1.9.0, expected version is 1.7.1.(其元数据的二进制版本为1.9.0,预期版本为1.7.1)。

在网上找了很多方法,按照他们说的做了之后,由于本人愚钝还是不行。

最终,老天爷保佑,让我找到了解决方法。

其实也很简单:根据报错信息提到的1.90和1.7.1在整个项目全局搜索‘1.7.1’这个词,最终找到

在settings.gradle文件里找到这行代码: id "org.jetbrains.kotlin.android" version "1.7.10" apply false。把这行代码里的1.7.10改成1.9.0。然后运行,大功告成,原来如此简单。

值得注意的是,运行过程中网络必须通畅,最好有个网速不错的科学上网方式,否则经常下载失败。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值