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

Andrew Watson

12/07/2023, 1:08 AM
On a related note, I was having some struggles with
LocalSoftwareKeyboardController
today. At first I thought perhaps that it was an Android-only variant class in compose, but actually digging a bit more into Compose Multiplatform it is theoretically supposed to be there, on at least iOS and Android. Has anyone gotten it to work? When I tried to use it on my Android compose multiplatform build it crashed saying it couldn't find the class. I can't add
compse.ui.platform
in the gradle deps
commonMain
(which is where it resides) but I can add
compose.ui
. If anyone has any examples of this I'd love to hear about it
z

Zach Klippenstein (he/him) [MOD]

12/07/2023, 3:46 PM
Which version of compose are you using, and which version are your dependencies using? LSKC was experimental until fairly recently, and when we stabilized it we also changed it from a class to a proper composition local. So if one of your dependencies is using a mismatched version and trying to do something with that api, it will be expecting a class instead of a val.
a

Andrew Watson

12/07/2023, 9:22 PM
@Zach Klippenstein (he/him) [MOD] here is what I've got in my TOML:
Copy code
compose = "1.5.4"
compose-plugin = "1.5.11"
compose-preview = "1.6.0-beta02"
compose-compiler = "1.5.5"
agp = "8.1.4"
z

Zach Klippenstein (he/him) [MOD]

12/08/2023, 7:51 PM
I’m not sure if preview and compose not matching would cause this. You can use Gradle to see what versions your dependencies are depending on.
a

Andrew Watson

12/08/2023, 7:53 PM
z

Zach Klippenstein (he/him) [MOD]

12/08/2023, 7:54 PM
That’s different, the bug in this thread is a class not found exceptions IIUC
a

Andrew Watson

12/08/2023, 7:54 PM
DOH
AHHH
Sorry, need to read my own OP
These are good suggestions, I'll play around with aligning versions