升级到带有Kotlin 1.4.30错误的Jetpack Compose 1.0.0-alpha12 [英] Upgrading to Jetpack Compose 1.0.0-alpha12 with Kotlin 1.4.30 error
问题描述
使用Kotlin 1.4.30升级到Jetpack Compose 1.0.0-alpha12之后,还使用 Activity 1.3.0-alpha02
修复了 setContent
,但仍然出现错误
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
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'
}
也有警告此版本的编译器不支持标记:-Xallow-jvm-ir-dependencies
无论是否将 freeCompilerArgs + = ["-Xallow-jvm-ir-dependencies"]
保留在 kotlinOptions
下
推荐答案
一旦我升级到Compose 1.0.0-beta01,kotlin.collection(例如arrayListOf,listOf,...)将不再隐式导入.你也有想到吗?
Once I upgraded to Compose 1.0.0-beta01, kotlin.collections such as arrayListOf, listOf, ... are not implicity imported anymore. Did it occur to you too ?
这篇关于升级到带有Kotlin 1.4.30错误的Jetpack Compose 1.0.0-alpha12的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!