magnumrocha
11/29/2020, 9:07 AMCompose
ready to work with Kotlin 1.4.20
?
I am asking it because I have a project working fine with Kotlin 1.4.10
, but when I try to update it to Kotlin 1.4.20
the compilation fails:
The root cause java.lang.NoSuchMethodError was thrown at:
e: java.lang.IllegalStateException: Backend Internal error: Exception during file facade code generation
File being compiled: file:///Users/magnumrocha/personal/my_app/app/src/main/java/com/myapp/Commons.kt
androidx.compose.compiler.plugins.kotlin.lower.ClassStabilityFieldSerializationPlugin.afterClass(ClassStabilityFieldSerializationPlugin.kt:57)
the `Commons.kt`:
sealed class MenuAction(@StringRes val label: Int, val icon: VectorAsset) {
object History : MenuAction(R.string.history_menu, Icons.Outlined.List)
object About : MenuAction(R.string.about_menu, <http://Icons.Outlined.Info|Icons.Outlined.Info>)
}
Foso
11/29/2020, 9:12 AMmagnumrocha
11/29/2020, 9:13 AMallan.conda
11/29/2020, 9:59 AMmagnumrocha
12/04/2020, 2:11 PMmagnumrocha
12/04/2020, 2:19 PMkotlin 1.4.10
with compose 1.0.0-alpha08
jim
12/04/2020, 3:10 PM1.0.0-alpha08
, as that error can only occurs if you are using Kotlin 1.4.20 with an older version of Compose.
@magnumrocha Kotlin 1.4.10
does NOT work with Compose 1.0.0-alpha08
so if you are using Kotlin 1.4.10
then you are NOT using Compose 1.0.0-alpha08
and vice versa.jim
12/04/2020, 3:12 PMkotlinCompilerVersion
and your kotlinCompilerExtensionVersion
and to kill all gradle daemons and kill your gradle cache before performing your build.magnumrocha
12/04/2020, 3:19 PM1.0.0-alpha07
) and everything works wellmagnumrocha
12/04/2020, 3:20 PMcomposeOptions {
kotlinCompilerVersion "1.4.10"
kotlinCompilerExtensionVersion '1.0.0-alpha07'
}
dependencies {
...
// Jetpack Compose libraries
def compose_version = "1.0.0-alpha08"
implementation "androidx.compose.ui:ui:$compose_version"
// Tooling support (Previews, etc.)
implementation 'androidx.ui:ui-tooling:1.0.0-alpha07'
// Foundation (Border, Background, Box, Image, Scroll, shapes, animations, etc.)
implementation "androidx.compose.foundation:foundation:$compose_version"
// Material Design
implementation "androidx.compose.material:material:$compose_version"
// Material design icons
implementation "androidx.compose.material:material-icons-core:$compose_version"
implementation "androidx.compose.material:material-icons-extended:$compose_version"
// Integration with observables
implementation "androidx.compose.runtime:runtime-livedata:$compose_version"
// Navigation for Compose
implementation "androidx.navigation:navigation-compose:1.0.0-alpha03"
}
David Edwards
12/04/2020, 3:45 PMmagnumrocha
12/04/2020, 3:47 PMkotlin 1.4.20
with compose 1.0.0-alpha08
working?David Edwards
12/04/2020, 3:48 PM.gradle/caches
before, but that seemed to do the trick.magnumrocha
12/04/2020, 3:48 PMmagnumrocha
12/04/2020, 3:57 PM