简体   繁体   English

升级到带有 Kotlin 1.4.30 错误的 Jetpack Compose 1.0.0-alpha12

[英]Upgrading to Jetpack Compose 1.0.0-alpha12 with Kotlin 1.4.30 error

After upgrading to Jetpack Compose 1.0.0-alpha12 with Kotlin 1.4.30, also with Activity 1.3.0-alpha02 fix for setContent , but still got an error在使用 Kotlin 1.4.30 升级到 Jetpack Compose 1.0.0-alpha12 后,还setContent进行了Activity 1.3.0-alpha02修复,但仍然出现错误

Execution failed for task ':app:mergeDebugJavaResource'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction
   > 2 files found with path 'META-INF/AL2.0' from inputs:

Had to use the workaround to make it built不得不使用解决方法来构建它

    packagingOptions {
        exclude 'META-INF/AL2.0'
        exclude 'META-INF/LGPL2.1'
    }

And also have the warning Flag is not supported by this version of the compiler: -Xallow-jvm-ir-dependencies并且还有Flag is not supported by this version of the compiler: -Xallow-jvm-ir-dependencies

No matter keeping freeCompilerArgs += ["-Xallow-jvm-ir-dependencies"] under kotlinOptions or not无论是否在 kotlinOptions 下保留kotlinOptions freeCompilerArgs += ["-Xallow-jvm-ir-dependencies"]

The issue got fixed once upgrading to Compose 1.0.0-beta01 .该问题在升级到 Compose 1.0.0-beta01后得到解决。 No workaround needed.无需解决方法。

Once I upgraded to Compose 1.0.0-beta01, kotlin.collections such as arrayListOf, listOf, ... are not implicity imported anymore.一旦我升级到 Compose 1.0.0-beta01,kotlin.collections 诸如 arrayListOf、listOf、...之类的将不再隐式导入。 Did it occur to you too?你也发生过吗?

You must use compatible versions of compose and Kotlin.您必须使用 compose 和 Kotlin 的兼容版本。 Compose beta08 and Kotlin 1.5.10 are compatible Compose beta08 和 Kotlin 1.5.10 兼容

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 升级到 Jetpack Compose Alpha 12 会导致 setContent 出现错误 - Upgrading to Jetpack Compose Alpha 12 causes errors on setContent 为什么升级到jetpack compose 1.0.0-beta01后没有隐式导入kotlin.collections? - Why kotlin.collections is not implicitly imported after upgrading to jetpack compose 1.0.0-beta01? OutlineTextField 、TextField 在 Jetpack Compose 1.0.0-alpha02 中不起作用 - OutlineTextField , TextField not working in Jetpack Compose 1.0.0-alpha02 Jetpack compose - 使用 1.0.0-alpha02 嵌套导航 - Jetpack compose - nested navigation with 1.0.0-alpha02 Jetpack 撰写“文本”function 已弃用 (1.0.0-alpha09) - Jetpack compose “Text” function deprecated (1.0.0-alpha09) java.lang.NoSuchMethodError startRestartGroup 升级 Jetpack Compose 到 1.0.0-beta07 后 - java.lang.NoSuchMethodError startRestartGroup after upgrading Jetpack Compose to 1.0.0‑beta07 使用 Jetpack Compose 1.0.0-alpha11 时如何手动导入扩展函数? - How to manually import extension functions when using Jetpack Compose 1.0.0-alpha11? Kotlin 1.6、Jetpack Compose 1.1.0编译错误 - Kotlin 1.6, Jetpack Compose 1.1.0 compilation error 将 Jetpack Compose 升级到 1.0.0‑beta07 后出现 java.lang.NoSuchMethodError - java.lang.NoSuchMethodError after upgrading Jetpack Compose to 1.0.0‑beta07 Jetpack Compose Kotlin 说 - Jetpack Compose Kotlin says
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM