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

Zoltan Demant

02/21/2024, 2:12 PM
Im on Windows, and a couple of times a month my composables become unresolved like in the screenshot below. It doesnt happen to all of them, and sometimes I can even compile & run my projects. Its that time of month, and I thought Id at least ask here if anyone else runs into this every once in a while; and whether theres an open issue or workaround available? Ive tried invalidate caches, repair IDE, reboot, stare into the void, nothing seems to help - usually it sorts itself out after enough pain. Oh and this has only ever happened with composable functions, and when it happens it affects all my projects at the same time.
🥲 1
g

Garret Yoder

02/21/2024, 2:35 PM
Have you ever tried clearing gradle's cache? Invalidating from the IDE does not do this
z

Zoltan Demant

02/21/2024, 2:35 PM
Do you mean deleting .gradle?
g

Garret Yoder

02/21/2024, 2:35 PM
I get gradle weirdmess pretty frequently - the other day my caches somehow wound up in such a bad state after trying to copy a file that it'd instantly freeze the IDE the moment I opened it. Clearing all of gradle's cache fixed it.
Usually in your home folder there is a hidden gradle folder that has caches in it
eg; ~/.gradle/caches on macOS
z

Zoltan Demant

02/21/2024, 2:36 PM
I cant recall if Ive tried that, but will do next time this happens (it started working after I wrote this post 😅)
g

Garret Yoder

02/21/2024, 2:37 PM
Note that clearing that will delete all of the cached downloads so you might be staring at a indexing bar for quite awhile after that.
z

Zoltan Demant

02/21/2024, 2:37 PM
But definitely feels cache related
As long as it works, Im ok with that 😄
g

Garret Yoder

02/21/2024, 2:37 PM
Usually fixes my issue when gradle misbehaves. I haven't bothered to figure out what cache exactly in that folder is the culprit, I just know nuking the entire gradle cache usually fixes it.
z

Zoltan Demant

02/21/2024, 3:07 PM
Well I appreciate it, good to have a clear and concise thing I can try next time I run into it! Also curious if others are running into this.. probably worth filing a bug if thats the case 🙂
s

Sean Proctor

02/23/2024, 12:13 AM
I had a very similar thing happen when I was on a flaky connection. Gradle cached a particular version of a library and every build using that version of that library would fail until I deleted the cache.
👍🏽 1
2 Views