我可以在哪里放置 `suppressKotlinVersionCompatibilityCheck` 标志? [英] Where can I put the `suppressKotlinVersionCompatibilityCheck` flag?

查看:232
本文介绍了我可以在哪里放置 `suppressKotlinVersionCompatibilityCheck` 标志?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 kotlin 的 1.4.21-2 版本,这是一个最新版本,它有一个修复程序,允许您使用 Compose + Kotlin 序列化而不会挂起构建.这一切都很好,但是,Compose 编译器不知道它并给出以下(相当无用的)错误:

I'm trying to use the 1.4.21-2 version of kotlin which is a recent version that has a fix that allows you to use Compose + Kotlin serialization without the build hanging. This is all great, however, the Compose compiler does not know about it and gives the following (rather unhelpful) error:

e:Compose Compiler 的此版本 (1.0.0-alpha09) 需要 Kotlin 1.4.21 版,但您似乎使用的是 Kotlin 1.4.21-2 版,该版本不兼容.请修复您的配置(或 suppressKotlinVersionCompatibilityCheck 但不要说我没有警告您!).

e: This version (1.0.0-alpha09) of the Compose Compiler requires Kotlin version 1.4.21 but you appear to be using Kotlin version 1.4.21-2 which is not known to be compatible. Please fix your configuration (or suppressKotlinVersionCompatibilityCheck but don't say I didn't warn you!).

我很想提供那个抑制标志,但是我不知道把它放在哪里......我花了大约一个小时试图把它放在我的 gradle 文件中的随机位置,例如在 composeOptions,但没有运气.我也尝试了我知道的所有 google-fu,但似乎没有人真正使用过它并写过任何相关内容.

I would love to provide that suppression flag, however I don't know where to put it... I've spent about an hour trying to put it in random places in my gradle files, for example in composeOptions, but no luck. I also tried all the google-fu I know, but nobody seems to have actually used this and wrote anything about it.

有什么办法可以摆脱困境吗?

Any ideas how to get out of that predicament?

推荐答案

这是一个命令行参数.

请参阅此示例/a>

See this example in a kts file here

-P plugin:androidx.compose.compiler.plugins.kotlin:suppressKotlinVersionCompatibilityCheck=true

这篇关于我可以在哪里放置 `suppressKotlinVersionCompatibilityCheck` 标志?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆