Hello! I'm using compose multiplatform and while o...
# compose
p
Hello! I'm using compose multiplatform and while on desktop version all is ok, on Android my app crash with
Copy code
java.lang.NoSuchMethodError: No interface method getCurrentCompositionLocalMap()Landroidx/compose/runtime/CompositionLocalMap; in class Landroidx/compose/runtime/Composer; or its super classes
I tried to use different versions of compose from 1.4.3 to 1.5.0-beta02 but got the same exception on startup. Any advices what should be checked to solve it?
w
save code in github and share it
p
Hello, Adam! I can't, cause it is private project. May be there are some general advises for that case. It seems that it is about dependencies versions compatibility.
Solved! Need to explicitly add dependencies compose-ui. Previously was only material3 dependency, so project transitively depend on it.
a
can you give an example how to eplicitly add diff versions?,
p
The problem was that I have dependency on jvm target from android target. And some methods in CMP where not present in Android compose lib. While compiling separetelly it was ok, but at runtime it throws. Now i change my project to classic KMP project.
So CMP automatically substitute needed dependency for Android and other targets
What is your issue?
a
i have large projects, where im using ModalBottomSheetLayout, our existing version material is 1.3.3, but for some reason we need to add new feature where we must use material version of 1.5.4, but in 1.5.4 version ModalBottomSheetLayout is remove, and its not possible to revamp all the component to use version 1.5.4, so we want to try if we can use materil version of 1.5.4 but at the same time also use 1.3.3 so old component still can run (at least untul we have time to do migration)
p
I think you shouldnt do like this, cause you can got runtime errors like in origin message cause classes can may be 'shuffled' (or got lint error on duplicate classes). What I can suggest is to copy needed sources of missing component to your project.