Closed mlewandowskipt closed 1 month ago
That's the side effect of supporting Compose multiplatform (since version 4.0.0 of resaca), only version 1.7.0+ of Compose Multiplatform supports the multiplatform lifecycle artifacts required for ViewModels.
If you want to use stable Compose and you don't care about multiplatform you can stick to resaca 3.3.7 for the time being. The majority of the features and fixes introduced since then are all related to Compose Multiplatform.
As soon as Compose Multiplatform 1.7.0 is stable I would keep this library on stable releases of Compose for both native Android and Multiplatform.
Ok but does it actually make sense to add multiplatform dependency to the resaca-android
artifact? Maybe there should be explicit resaca-multiplatform
artifact that depends on multiplatform libraries? My project is pure Android so it doesn't need Compose Multiplatform runtime. For now I will exclude it by having something like
configurations.all {
exclude(group = "org.jetbrains.compose.runtime", module = "runtime")
}
but it's kind of a workaround.
Ok but does it actually make sense to add multiplatform dependency to the
resaca-android
artifact? Maybe there should be explicitresaca-multiplatform
artifact that depends on multiplatform libraries? My project is pure Android so it doesn't need Compose Multiplatform runtime. For now I will exclude it by having something likeconfigurations.all { exclude(group = "org.jetbrains.compose.runtime", module = "runtime") }
but it's kind of a workaround.
Thanks for the suggestion, that's actually how the multiplatform feature started in early proof of concepts but I soon realized that a separate artifact would complicate a lot packaging and testing with potentially different versions of Compose, lifecycle and ViewModel libraries per resaca artifact.
I apologize for the inconvenience. Your workaround should be as good as staying with version 3.3.7 for Android-only projects.
Actually excluding Compose Multiplatform runtime resulted in
java.lang.NoSuchMethodError: No interface method startReplaceGroup(I)V in class Landroidx/compose/runtime/Composer; or its super classes (declaration of 'androidx.compose.runtime.Composer' appears in /data/app/~~NnMAa01zYOFCIoqSOmn7Mw==/com.myapp-a79RJAaUiG_IAD3mVWB80g==/base.apk)
even though I have AndroidX Runtime 1.6.8 bundled within the app so I'll just downgrade to 3.3.7
To continue supporting Compose stable in this library until the Compose Multiplatform team makes a new release with support for Compose stable, I will continue to support the 3.x version of resaca and backport any important feature or bugfix from the 4.x branches to the 3.x one.
To put that into action, I backported fix in PR138 from 4.1.4 to 3.3.8
Once the 4.x releases contain a Compose stable release I will close this ticket.
Resolved in release 4.3.2, this includes stable versions of Compose for Android included in Compose multiplatform, see release notes.
Affected version: 4.1.3, probably also earlier ones
Steps to reproduce:
./gradlew :app:dependencies > out
In output you can see that resaca adds unstable version of Compose runtime:
which replaces stable version added to the project, possibly resulting in some hard-to-track incompatibilities: