&gt; Originally shared in <#C3PQML5NU|multiplatfor...
# compose
j
Originally shared in #multiplatform.
Seeing this compiler
BackendException
on AS when building a multi module KMM project which uses Jetpack compose
Copy code
org.jetbrains.kotlin.backend.common.BackendException: Backend Internal error: Exception during IR lowering
and this as render problems when preview tries to load in between
Copy code
java.lang.NoSuchMethodError: 'void androidx.compose.material.TextKt.Text...'
Found a few other people who had the same issue here, on the issuetracker and even on SOF but none of the solutions that worked for them, worked for me unfortunately. More details in the 🧵 .
Using -
Copy code
Android Studio Bumblebee | 2021.1.1 Beta 1
gradle plugin - 7.1.0-beta01 | wrapper - 7.2
kotlin - 1.5.31
compose - 1.1.0-alpha06
Project structure-
Copy code
Proj
----buildSrc
----kmmApp
----------androidApp // includes compose
----------iosApp
----------shared
-------------androidMain
-------------iosMain
-------------commonMain
----kmmLib1
----------androidMain // includes compose
----------iosMain
----------commonMain
----kmmLib2
----------androidMain
----------iosMain
----------commonMain
----settings.gradle.kts // include(":kmmApp:shared", ":kmmApp:androidApp", "kmmLib1", "kmmLib2")
So far I’ve tried - • Since I was using
buildSrc
, added the fix suggested here • added this to all modules
Copy code
buildFeatures.compose = true
composeOptions.kotlinCompilerExtensionVersion = "1.1.0-alpha06"
• Multiple rounds of clean, rebuild and Invalidate caches, even a system reboot to see if I’d get lucky. • Add remove compose and build as @Marko Novakovic suggested. • switched to stable compose
1.0.4
m
I was getting this error when I wanted to add
Compose
to existing Android app. I was stuck with this for 2-3 weeks
I was removing and re-adding
Compose
over and over again and it worked somehow even tho working project and project with error looked completely the same….
j
I just tried that and my Gradle build just doesn’t finish building once I add compose back just to the
androidApp
module. 🥲 . Cancelling the build also runs indefinitely. Force quitting AS and trying again. Update: Got
Timeout waiting to lock file hash cache
error after reopening AS, so deleted gradle caches and rebuilding again.
Finally it rebuilt after 45 mins but the issue still remain.
😧 1
Tried run & Install on a device but crashes with this on open-
NoSuchMethodError: No static method setContent
m
exact problem I had. can’t help you here, I solved it by adding to compose to my app over and over and over and over
j
Also this is how the preview looks.
A minimal sample to reproduce the issue if that’d help. checkout
main
.
This is still not fixed. I have posted issue here hoping it reaches the right people.