1

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'
    }

And also have the warning 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

joyl1216
  • 303
  • 1
  • 3
  • 10

3 Answers3

1

The issue got fixed once upgrading to Compose 1.0.0-beta01. No workaround needed.

joyl1216
  • 303
  • 1
  • 3
  • 10
0

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 ?

  • Your answer (question? :-)) is not related to the question author asked... However, I tried to answer your question at https://stackoverflow.com/questions/66369899/why-kotlin-collections-is-not-implicitly-imported-after-upgrading-to-jetpack-com/66404390#66404390 – David Kneys Feb 27 '21 at 23:31
0

You must use compatible versions of compose and Kotlin. Compose beta08 and Kotlin 1.5.10 are compatible

Richard Onslow Roper
  • 5,477
  • 2
  • 11
  • 42