1

I'm using compose version compose-bom 2023.03.00 and when I try to add the latest compose animation module (1.7.0-alpha07) with shared elements update, the app crashes on launch with error showing

java.lang.NoSuchMethodError: No static method restrictedConstraints-xF2OJ5Q$default(Landroidx/compose/ui/unit/Constraints$Companion;IIIIZILjava/lang/Object;)J in class Landroidx/compose/ui/unit/Constraints$Companion; or its super classes (declaration of 'androidx.compose.ui.unit.Constraints$Companion' appears in /data/app/com.xx.xxxx-55o2y0IBA6N3Qr0mj4DgbQ==/base.apk

at androidx.compose.foundation.layout.RowColumnMeasurementHelper.measureWithoutPlacing-EkL-Y(RowColumnMeasurementHelper.kt:187) at androidx.compose.foundation.layout.RowColumnMeasurePolicy.measure-3p2s80s(RowColumnImpl.kt:69) at androidx.compose.ui.node.InnerNodeCoordinator.measure-BRTryo0(InnerNodeCoordinator.kt:135) at androidx.compose.foundation.layout.SizeNode.measure-3p2s80s(Size.kt:838)

Just adding the dependency itself causes the crash (without adding any ShareElementsLayout etc).

IN a sample app, it works fine. Is it due to any compatibility issues with other compose libraries ? How can I find the issue due to incompatibility issues ?

I tried matching the sample app's dependency versions (1.7.0-beta01 also has issues), but there are other libraries also found in our main app.

It also created the same crash.

1
  • 1
    If you are using the BOM, it's best to let the BOM pick the correct version for you. If you need pre-release features you could try - github.com/chrisbanes/compose-bom Commented May 30, 2024 at 12:54

1 Answer 1

0

Adding the dependency implementation("androidx.compose.material:material:1.7.0-beta01") along with the compose-animation 1.7.0 beta01, which seems to make the project run without any issues.

I'm still not sure about this particular dependency. I've tried to add the material:material library in the bom.

But the project by philip lackner - https://github.com/philipplackner/SharedElementTransitionCompose/blob/master/gradle/libs.versions.toml

uses a combination of stable bom with compose animation alpha, which seems to be working fine. Maybe there is some extra dependencies in my project which contributes this issue.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.