I was just updating a project of mine and am now g...
# compose
t
I was just updating a project of mine and am now getting this error:
e: androidx.compose.compiler.plugins.kotlin.IncompatibleComposeRuntimeVersionException: The Compose Compiler requires the Compose Runtime to be on the class path, but none could be found. The compose compiler plugin you are using (version 1.5.14) expects a minimum runtime version of 1.0.0.
I don't understand why this is happening since I have updated projects before without a problem. I am attempting to upgrade to Kotlin 2.0.20. I have applied the
org.jetbrains.kotlin.plugin.compose
to my project build.gradle and to my modules via convention plugins
1
Can someone help with this. I still haven't figured it out
1
m
Starting with kotlin 2.0 you have to use the "Compose Gradle Plugin". See:
t
I have that if you look at the last line of my Toml
m
What does your app/build.gradle.kts look like? You have to add the plugin version in your top level build.gradle.kts, and add the plugin in your app/build.gradle.kts (with a lot of other changes as well).
t
Yes I have added it to the project build gradle and to my compose convention plugins
m
It could be a cache problem, try invalidating all your caches and reload the project. (And with that I have shot my wad, sorry).
One more thing: you are using an ancient bom, the current bom is 2024.09.02
t
I think I have done that already, but I'll make sure to try it when I get home. I will also update the BOM just in case. Thanks for the effort
I forgot I had a GitHub action so I just tried it via that. Same exception
m
The bottom line is that gradle thinks you want to use compose 1.5.14 compiler, which means it is reading that number somewhere in your project files. If you are using linux try at the root directory of your project the command: find -type f -print0| xargs -0 '1\.\5\.14' and what you do then depends where it is found. It may well be located in your ~/.gradle/ directory, and I recently found that old files in your build directory screw things up so just doing a Build -> Clean might fix things.
t
My code is Running a pipeline so there is no old build data. Though I also checked on my machine and there is no 1.5.14 anywhere
m
Somewhere in that pipeline there must be a machine that has not been updated to kotlin 2.0.20 I suspect -- the number is not coming out thin air.
t
Locally the same issue is happening so it isn't the pipeline
m
Try removing all the contents of your ~/.gradle/cache, and if that does not work remove the .idea dirctory of the project and re-import the project.
t
I don't think you are understanding. There is no such thing as a cache on the pipeline. It is a clean machine every time
m
What version of android Studio are you using?
t
Doesn't matter. The Pipeline does not use android studio it is command line based commands
m
I have only used android studio. so I am really unable to understand your setup -- sorry.
Could gradle be reading 1.5.14 from your environment variables? What is the results of typing the command: set | grep 1.5.14
t
It isn't set in the environment
m
What version of gradle are you using, and what version of java is it using?
t
Gradle is in Toml. Java is 17
m
AGP is now 8.6.1, and a lot of your other versions look old to me (but that shouldn't matter). Could gradle be getting the number 1.5.14 from the internet? Once you find out where that number is coming from you are halfway home as far as I can see.
t
The issue is not that number though it is the missing runtime
m
What version is your gradle file itself. The latest version is gradle-8.7-all.zip
t
It isn't a gradle issue. I use dependabot to keep everything compatible and up to date
m
Your toml is not up to date, but again it is not so old as to be an issue. Try typing ./gradlew -v
t
I found the issue... Turns out my brain just doesn't work. I was trying to add the
org.jetbrains.kotlin.plugin.compose
plugin to non-compose convention plugins....
plus1 1
m
That's one of the problems with toml, just too fancy for something that is very easy to do in the build.gradle.kts files themselves, but I am a bit of a luddite some days.
b
hi @Tom Truyen I have same error message. But android is working, only when running from Xcode(iOS) I have this error.
706 Views