https://kotlinlang.org logo
#compose
Title
# compose
o

oscarg798

08/28/2020, 3:34 PM
hi guys, has someone idea about what this error means
Copy code
Class 'androidx.compose.runtime.Composable' is compiled by a new Kotlin compiler backend and cannot be loaded by the old compiler
l

Leland Richardson [G]

08/28/2020, 3:40 PM
what is your gradle setup? This is an indication that you’re trying to compile your code with an older kotlin compiler than what compose runtime got compiled with. Make sure you’re using kotlin 1.4
o

oscarg798

08/28/2020, 3:43 PM
Yeah I’m using 1.4, min sdk 23
I ran the task failing with stacktrace, seems that I forgot to add
Copy code
useIR = true
lets see if it works
yeah that was the issue
l

Leland Richardson [G]

08/28/2020, 3:49 PM
ah, that makes sense 👍
👍 2
e

Esmaeel Nabil

08/28/2020, 3:49 PM
Copy code
useIR = true
what this means ? @Leland Richardson [G]
2
l

Leland Richardson [G]

08/28/2020, 3:50 PM
this has the kotlin compiler use the new IR backend that they’ve been working on. compose depends on this backend
buildFeatures { compose true }
should turn this on though
was this on a non-compose enabled module in your app?
e

Esmaeel Nabil

08/28/2020, 3:52 PM
for me ? no it’s in a compose project, but i just wanted to know the meaning of it, thanks.
o

oscarg798

08/28/2020, 3:53 PM
for me neither, I have viewBinding enabled but I’m trying to add compose to my project but has been a nightmare haha
l

Leland Richardson [G]

08/28/2020, 3:56 PM
ah. yeah, i’m not personally sure how well viewBinding and compose inter-mix. I think some others have tried it out but I have not
m

Mahdi

11/15/2020, 8:14 AM
@oscarg798 Hi I have same problem. I got this issue when try to check state value in break point. did you find any solution? My issue is inside composable functions. https://stackoverflow.com/questions/64842355/android-studio-canary-4-2-16-on-evaluate-variables-got-error-state-is-compiled