https://kotlinlang.org logo
#compose-android
Title
# compose-android
c

Colton Idle

11/22/2023, 3:25 PM
Running out of ideas. I'm getting this crash
Copy code
java.lang.NoSuchMethodError: No virtual method at(Ljava/lang/Object;I)Landroidx/compose/animation/core/KeyframesSpec$KeyframeEntity; in class Landroidx/compose/animation/core/KeyframesSpec$KeyframesSpecConfig; or its super classes (declaration of 'androidx.compose.animation.core.KeyframesSpec$KeyframesSpecConfig' appears in /data/data/com.myapp.android.internal/code_cache/.overlay/base.apk/classes.dex)
Typically this means some mismatch of compose versions and accompanist, but everything is looking good to go on that front. Anyone have other ideas on what I should be looking at. I'm using latest stable of compose and compiler (1.5.4) and accompanist 0.32.0.
s

Stylianos Gakis

11/22/2023, 3:33 PM
I got this crash exactly when I brought in one alpha dependency on some foundation dependency without bumping anything else (I wanted to test something). You can check your dependencies to see who is the culprit of bringing in some of the non-stable compose libraries which breaks this.
c

Colton Idle

11/22/2023, 3:37 PM
Yeah, I tried identifying that but this project is pretty small so I just went line by line and didn't find any culprits. I also tried running gradlew dependencies, but everything seems to be pointing to latest stable.
v

vide

11/22/2023, 3:38 PM
your build cache might be somehow messed up
try deleting your build folder and gradle build cache
c

Colton Idle

11/22/2023, 3:42 PM
let me delete app/build and ~/.gradle/caches...
nope. same issue.
damn
v

vide

11/22/2023, 4:03 PM
I've had my fair share of cache problems and they usually always manifest in something like that 😅
Too bad that it wasn't that
c

Colton Idle

11/22/2023, 4:04 PM
So aggaravating. I feel like ive had this happen a few times. but its always a version mismatch, like Stylianos said. but nothing sticks out at me here. darn
Alright. I did find a ui-tooling dependency that wasn't on latest stable... lets rerun and see if that did the trick
👍 1
👍🏼 1
yep
thank goodness. what a waste of 4 hours. lol
s

Stylianos Gakis

11/22/2023, 4:23 PM
When I want to check for dependencies like that I always write the output to a file and try and do a proper search in there to find everything for sure. Or you can do a grep or something like that too. It’s always hard to do it with your eyes in-between so many lines of text 😄
c

Colton Idle

11/22/2023, 4:39 PM
Yeah. I gotta figure out the command for deps for a single variant too. Im so bad at gradle-ing lol
s

Stylianos Gakis

11/22/2023, 5:50 PM
Or remove the extra variants 😅
Damn it seems like I am getting this error now again, but now this was after I bumped to the current latest stable compose BOM, 2024.01.00. Anyone else experiencing the same with
No virtual method at(Ljava/lang/Object;I)Landroidx/compose/animation/core/KeyframesSpec$KeyframeEntity
?
Worst part is that I do not exactly remember all the context of me replying here 2 months ago and what I was doing back then 😂
a

Albert Chang

01/25/2024, 3:23 PM
Looks like it's because compose 1.6 is not binary compatible with 1.5 and latest stable M3 is built with compose 1.5. You need to use M3 1.2.0-rc01 or wait for the 1.2 stable release of M3.
s

Stylianos Gakis

01/25/2024, 5:59 PM
Yep, quite unfortunate that the bom which should be more like plug&play has shipped with this bug though. I suppose when m3 ships the 1.2 stable release we'll get a new bom version
j

jw

01/25/2024, 9:04 PM
I mean... Google should have already released a .1 today with the binary compat fix in the artifact and the BOM. What's taking so long? It fundamentally undermines one tenet of AndroidX. How did Metalava even let this slide?
K 1
s

Stylianos Gakis

01/26/2024, 11:05 AM
Couldn't agree more, this is a very weird thing to be allowed to be shipped by androidx imo 🤷‍♂️ I don't think I've seen a bom have versions that don't fit with each other. Definitely a tooling issue, not a human issue though of course. There should be alarms sounding even at the idea of releasing this.
6 Views