From b5b2d9f60ee34851fa4dca2f82ceb10074297621 Mon Sep 17 00:00:00 2001 From: Markus Hintersteiner Date: Mon, 16 Nov 2026 20:22:42 +0100 Subject: [PATCH 1/4] fix(replay): Support Compose 1.13 and mask whole Compose view on traversal failure --- CHANGELOG.md | 1 + sentry-android-replay/detekt-baseline.xml | 2 +- .../viewhierarchy/ComposeViewHierarchyNode.kt | 24 +++++- .../viewhierarchy/SentryLayoutNodeHelper.kt | 20 +++-- .../ComposeMaskingOptionsTest.kt | 76 +++++++++++++++++++ 5 files changed, 111 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b235002fab1..d98f11ab382 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ ### Fixes +- Session Replay: Fix Compose masking for Jetpack Compose 1.13. If the SDK can't walk the Compose tree of a screen, it now masks the whole Compose view instead of recording it unmasked ([#TBD](https://github.com/getsentry/sentry-java/pull/TBD)) - Session Replay: Send Ktor client network request start and end times in milliseconds, so the requests line up with the replay ([#6619](https://github.com/getsentry/sentry-java/pull/6619)) - Nav3: Stop attributing errors and spans from an Activity or ViewPager2 page without a `SentryNavEffect` to the most recently visited Nav3 root ([#6483](https://github.com/getsentry/sentry-java/pull/6483)) - Android: Count deep sleep in breadcrumb, screenshot and view hierarchy debounce windows, so the first low-memory or battery breadcrumb after a long Doze is no longer dropped ([#6590](https://github.com/getsentry/sentry-java/pull/6590)) diff --git a/sentry-android-replay/detekt-baseline.xml b/sentry-android-replay/detekt-baseline.xml index 8432d83f8dd..289a639e264 100644 --- a/sentry-android-replay/detekt-baseline.xml +++ b/sentry-android-replay/detekt-baseline.xml @@ -116,7 +116,7 @@ ReturnCount:ReplayGestureConverter.kt$ReplayGestureConverter$fun convert( event: MotionEvent, recorderConfig: ScreenshotRecorderConfig, ): List<RRWebIncrementalSnapshotEvent>? ReturnCount:ReplayIntegration.kt$ReplayIntegration$override fun captureReplay(isTerminating: Boolean?): SentryId ReturnCount:ScreenshotRecorder.kt$ScreenshotRecorder$fun capture() - ReturnCount:SentryLayoutNodeHelper.kt$SentryLayoutNodeHelper$@Suppress("UNCHECKED_CAST") fun getChildren(node: LayoutNode): List<LayoutNode> + ReturnCount:SentryLayoutNodeHelper.kt$SentryLayoutNodeHelper$@JvmStatic @Suppress("UNCHECKED_CAST") fun getChildren(node: LayoutNode): List<LayoutNode> ReturnCount:SentryLayoutNodeHelper.kt$SentryLayoutNodeHelper$fun isTransparent(node: LayoutNode): Boolean ReturnCount:ViewHierarchyNode.kt$ViewHierarchyNode.Companion$@JvmStatic fun fromView( view: View, parent: ViewHierarchyNode?, distance: Int, options: SentryMaskingOptions, ): ViewHierarchyNode ReturnCount:ViewHierarchyNode.kt$ViewHierarchyNode.Companion$private fun View.shouldMask(options: SentryMaskingOptions): Boolean diff --git a/sentry-android-replay/src/main/java/io/sentry/android/replay/viewhierarchy/ComposeViewHierarchyNode.kt b/sentry-android-replay/src/main/java/io/sentry/android/replay/viewhierarchy/ComposeViewHierarchyNode.kt index 2e40144e2de..9e4615ec36b 100644 --- a/sentry-android-replay/src/main/java/io/sentry/android/replay/viewhierarchy/ComposeViewHierarchyNode.kt +++ b/sentry-android-replay/src/main/java/io/sentry/android/replay/viewhierarchy/ComposeViewHierarchyNode.kt @@ -285,7 +285,8 @@ internal object ComposeViewHierarchyNode { } try { - val rootNode = (view as? Owner)?.root ?: return false + val rootNode = + (view as? Owner)?.root ?: error("${view::class.java.name} is not a Compose Owner") rootNode.traverse(parent, isComposeRoot = true, options, logger) } catch (e: Throwable) { logger.log( @@ -300,11 +301,28 @@ internal object ComposeViewHierarchyNode { .trimIndent(), ) // fail fast in our own sample/UI-test apps (see SentryReplayDebug), so regressions surface - // as crashes instead of silently skipping the whole Compose subtree (i.e. not masking it) + // as crashes instead of a fully masked Compose view if (SentryReplayDebug.failFast) { throw e } - return false + // We can't tell which parts of the Compose view are sensitive, so we mask all of it, + // regardless of the masking options + parent.children = + listOf( + GenericViewHierarchyNode( + x = parent.x, + y = parent.y, + width = parent.width, + height = parent.height, + elevation = parent.elevation, + distance = 0, + parent = parent, + shouldMask = true, + isImportantForContentCapture = true, + isVisible = parent.isVisible, + visibleRect = parent.visibleRect, + ), + ) } return true diff --git a/sentry-android-replay/src/main/java/io/sentry/android/replay/viewhierarchy/SentryLayoutNodeHelper.kt b/sentry-android-replay/src/main/java/io/sentry/android/replay/viewhierarchy/SentryLayoutNodeHelper.kt index 6cfe5ec6fc0..abea6f7cb0b 100644 --- a/sentry-android-replay/src/main/java/io/sentry/android/replay/viewhierarchy/SentryLayoutNodeHelper.kt +++ b/sentry-android-replay/src/main/java/io/sentry/android/replay/viewhierarchy/SentryLayoutNodeHelper.kt @@ -18,10 +18,13 @@ import java.lang.reflect.Method * This class is not thread-safe, as Compose UI operations are expected to be performed on the main * thread. * - * Compiled against Compose >= 1.10 where the mangled names use the "ui" module suffix (e.g. - * getChildren$ui()). For apps still on Compose < 1.10 (where the suffix is "$ui_release"), the - * direct call will throw [NoSuchMethodError] and we fall back to reflection-based accessors that - * are resolved and cached on first use. + * The internal `children` and `outerCoordinator` aren't called directly, as Kotlin mangles their + * JVM names with a module suffix that changed between Compose versions (`$ui_release` before 1.10, + * `$ui` in 1.10 - 1.12, `$androidx_compose_ui_ui` since 1.13). Since Compose 1.8, LayoutNode + * implements `SemanticsInfo`, whose unmangled `childrenInfo` and `isTransparent()` call them from + * within the Compose version the app ships. For apps on Compose < 1.8 the direct call will throw + * [NoSuchMethodError] and we fall back to reflection-based accessors on the `$ui_release` names, + * that are resolved and cached on first use. */ internal object SentryLayoutNodeHelper { private class Fallback(val getChildren: Method?, val getOuterCoordinator: Method?) @@ -37,16 +40,17 @@ internal object SentryLayoutNodeHelper { } } + @JvmStatic @Suppress("UNCHECKED_CAST") fun getChildren(node: LayoutNode): List { when (useFallback) { - false -> return node.children + false -> return node.childrenInfo as List true -> { return getFallback().getChildren!!.invoke(node) as List } null -> { try { - return node.children.also { useFallback = false } + return (node.childrenInfo as List).also { useFallback = false } } catch (_: NoSuchMethodError) { useFallback = true return getFallback().getChildren!!.invoke(node) as List @@ -57,7 +61,7 @@ internal object SentryLayoutNodeHelper { fun isTransparent(node: LayoutNode): Boolean { when (useFallback) { - false -> return node.outerCoordinator.isTransparent() + false -> return node.isTransparent() true -> { val fb = getFallback() val coordinator = fb.getOuterCoordinator!!.invoke(node) as NodeCoordinator @@ -65,7 +69,7 @@ internal object SentryLayoutNodeHelper { } null -> { try { - return node.outerCoordinator.isTransparent().also { useFallback = false } + return node.isTransparent().also { useFallback = false } } catch (_: NoSuchMethodError) { useFallback = true val fb = getFallback() diff --git a/sentry-android-replay/src/test/java/io/sentry/android/replay/viewhierarchy/ComposeMaskingOptionsTest.kt b/sentry-android-replay/src/test/java/io/sentry/android/replay/viewhierarchy/ComposeMaskingOptionsTest.kt index 607b81d888d..f21a1bc1a15 100644 --- a/sentry-android-replay/src/test/java/io/sentry/android/replay/viewhierarchy/ComposeMaskingOptionsTest.kt +++ b/sentry-android-replay/src/test/java/io/sentry/android/replay/viewhierarchy/ComposeMaskingOptionsTest.kt @@ -3,11 +3,15 @@ package io.sentry.android.replay.viewhierarchy import android.app.Activity +import android.content.Context +import android.graphics.Bitmap +import android.graphics.Rect import android.net.Uri import android.os.Bundle import android.os.Looper import android.view.View import android.view.ViewGroup +import android.widget.FrameLayout import androidx.activity.ComponentActivity import androidx.activity.compose.setContent import androidx.compose.foundation.layout.Arrangement @@ -32,6 +36,7 @@ import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import androidx.test.ext.junit.runners.AndroidJUnit4 import coil.compose.AsyncImage +import com.google.common.truth.Truth.assertThat import io.sentry.NoOpLogger import io.sentry.SentryOptions import io.sentry.android.replay.maskAllImages @@ -39,6 +44,7 @@ import io.sentry.android.replay.maskAllText import io.sentry.android.replay.sentryReplayMask import io.sentry.android.replay.sentryReplayUnmask import io.sentry.android.replay.util.ComposeTextLayout +import io.sentry.android.replay.util.MaskRenderer import io.sentry.android.replay.util.traverse import io.sentry.android.replay.viewhierarchy.ViewHierarchyNode.GenericViewHierarchyNode import io.sentry.android.replay.viewhierarchy.ViewHierarchyNode.ImageViewHierarchyNode @@ -287,6 +293,74 @@ class ComposeMaskingOptionsTest { assertTrue(genericNodes.none { it.shouldMask }) } + @Test + fun `when walking the Compose tree throws a LinkageError, the whole Compose view is masked`() { + assertComposeViewFullyMaskedWhenGetChildrenThrows(NoSuchMethodError()) + } + + @Test + fun `when walking the Compose tree throws a RuntimeException, the whole Compose view is masked`() { + assertComposeViewFullyMaskedWhenGetChildrenThrows(IllegalStateException()) + } + + @Test + fun `when a Compose view has no Owner, the whole view is masked`() { + val activity = buildActivity(ComponentActivity::class.java).setup() + val composeView = AndroidComposeViewWithoutOwner(activity.get()) + activity.get().setContentView(composeView) + shadowOf(Looper.getMainLooper()).idle() + val options = + SentryOptions().apply { + sessionReplay.maskAllText = false + sessionReplay.maskAllImages = false + } + val composeViewNode = ViewHierarchyNode.fromView(composeView, null, 0, options.sessionReplay) + + val handled = + ComposeViewHierarchyNode.fromView( + composeView, + composeViewNode, + options.sessionReplay, + NoOpLogger.getInstance(), + ) + + assertTrue(handled) + assertThat(composeViewNode.renderMasks()).containsExactly(composeViewNode.visibleRect) + } + + private fun assertComposeViewFullyMaskedWhenGetChildrenThrows(error: Throwable) { + val activity = buildActivity(ComposeMaskingOptionsActivity::class.java).setup() + shadowOf(Looper.getMainLooper()).idle() + val options = + SentryOptions().apply { + sessionReplay.maskAllText = false + sessionReplay.maskAllImages = false + } + val composeView = assertNotNull(activity.get().window.decorView.lookupComposeView()) + val composeViewNode = ViewHierarchyNode.fromView(composeView, null, 0, options.sessionReplay) + + val handled = + Mockito.mockStatic(SentryLayoutNodeHelper.javaClass).use { + mock: MockedStatic -> + mock.`when` { SentryLayoutNodeHelper.getChildren(any()) }.thenThrow(error) + + ComposeViewHierarchyNode.fromView( + composeView, + composeViewNode, + options.sessionReplay, + NoOpLogger.getInstance(), + ) + } + + assertTrue(handled) + assertThat(composeViewNode.renderMasks()).containsExactly(composeViewNode.visibleRect) + } + + private fun ViewHierarchyNode.renderMasks(): List { + val bitmap = Bitmap.createBitmap(1000, 2000, Bitmap.Config.ARGB_8888) + return MaskRenderer().use { it.renderMasks(bitmap, this) } + } + private inline fun Activity.collectNodesOfType(options: SentryOptions): List { val root = window.decorView val viewHierarchy = ViewHierarchyNode.fromView(root, null, 0, options.sessionReplay) @@ -319,6 +393,8 @@ class ComposeMaskingOptionsTest { } } +private class AndroidComposeViewWithoutOwner(context: Context) : FrameLayout(context) + private class ComposeMaskingOptionsActivity : ComponentActivity() { companion object { var textModifierApplier: (() -> Modifier)? = null From f0dfd3375aa2867a06e078d8784aa4d68d68f9f6 Mon Sep 17 00:00:00 2001 From: Markus Hintersteiner Date: Mon, 16 Nov 2026 20:22:43 +0100 Subject: [PATCH 2/4] ci(replay): Run replay unit tests against multiple Compose UI versions --- .github/workflows/replay-compose-matrix.yml | 66 +++++++++++++++++++++ sentry-android-replay/build.gradle.kts | 17 ++++++ 2 files changed, 83 insertions(+) create mode 100644 .github/workflows/replay-compose-matrix.yml diff --git a/.github/workflows/replay-compose-matrix.yml b/.github/workflows/replay-compose-matrix.yml new file mode 100644 index 00000000000..9ee826ef4a1 --- /dev/null +++ b/.github/workflows/replay-compose-matrix.yml @@ -0,0 +1,66 @@ +name: Replay Compose Matrix + +# Session Replay calls Compose internals. Runs the replay unit tests against the last five Compose UI +# minor versions, so a renamed internal fails here instead of silently unmasking Compose content in +# apps. 1.9 is the oldest version the test composables can run on. +on: + push: + branches: + - main + pull_request: + paths: + - 'sentry-android-replay/**' + - 'gradle/libs.versions.toml' + - '.github/workflows/replay-compose-matrix.yml' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + replay-compose-matrix: + timeout-minutes: 30 + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + compose-ui: [ '1.9.5', '1.10.6', '1.11.4', '1.12.1', '1.13.0-rc01' ] + + name: Replay - Compose UI ${{ matrix.compose-ui }} + + steps: + - name: Checkout Repo + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + + - name: Setup Java Version + uses: actions/setup-java@77dd5b2ce225ea11469928ac317850245a74ae78 # v6.2.0 + with: + distribution: 'temurin' + java-version: '21' + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@8da46b539cd8fe6ab27ca75128919a18d757604c # v6.4.1 + + - name: Run replay unit tests + run: ./gradlew :sentry-android-replay:testReleaseUnitTest -PreplayTestComposeUiVersion=${{ matrix.compose-ui }} + + - name: Upload test results + if: always() + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7 + with: + name: test-results-replay-compose-${{ matrix.compose-ui }} + path: | + sentry-android-replay/build/reports/* + + - name: Test Report + uses: phoenix-actions/test-reporting@7317eea6e13c47348dd0bb318669485157c518d6 # pin@v16 + if: always() + with: + name: JUnit Replay Compose UI ${{ matrix.compose-ui }} + list-suites: 'failed' + list-tests: 'failed' + path: | + sentry-android-replay/build/test-results/**/*.xml + reporter: java-junit + output-to: step-summary + fail-on-error: false diff --git a/sentry-android-replay/build.gradle.kts b/sentry-android-replay/build.gradle.kts index 034268031b4..e8cc1424f42 100644 --- a/sentry-android-replay/build.gradle.kts +++ b/sentry-android-replay/build.gradle.kts @@ -102,6 +102,23 @@ dependencies { testImplementation(libs.coil.compose) } +// Runs the unit tests against another androidx.compose.ui version than the one they compile +// against, e.g. -PreplayTestComposeUiVersion=1.13.0-rc01, the same as an app that ships a newer +// Compose than the SDK was built with. Versions older than the test dependencies (Compose 1.9) +// don't +// work, as the test composables need a newer runtime. +providers.gradleProperty("replayTestComposeUiVersion").orNull?.let { composeUiVersion -> + configurations + .matching { it.name.endsWith("UnitTestRuntimeClasspath") } + .configureEach { + resolutionStrategy.eachDependency { + if (requested.group == "androidx.compose.ui") { + useVersion(composeUiVersion) + } + } + } +} + tasks.withType().configureEach { // Target version of the generated JVM bytecode. It is used for type resolution. jvmTarget = JavaVersion.VERSION_1_8.toString() From d0d4b2316a242ab84abf79596bc57b85a6303209 Mon Sep 17 00:00:00 2001 From: Markus Hintersteiner Date: Mon, 16 Nov 2026 20:22:59 +0100 Subject: [PATCH 3/4] docs(changelog): Add PR link for Compose 1.13 fix --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d98f11ab382..62f79316664 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,7 +22,7 @@ ### Fixes -- Session Replay: Fix Compose masking for Jetpack Compose 1.13. If the SDK can't walk the Compose tree of a screen, it now masks the whole Compose view instead of recording it unmasked ([#TBD](https://github.com/getsentry/sentry-java/pull/TBD)) +- Session Replay: Fix Compose masking for Jetpack Compose 1.13. If the SDK can't walk the Compose tree of a screen, it now masks the whole Compose view instead of recording it unmasked ([#6626](https://github.com/getsentry/sentry-java/pull/6626)) - Session Replay: Send Ktor client network request start and end times in milliseconds, so the requests line up with the replay ([#6619](https://github.com/getsentry/sentry-java/pull/6619)) - Nav3: Stop attributing errors and spans from an Activity or ViewPager2 page without a `SentryNavEffect` to the most recently visited Nav3 root ([#6483](https://github.com/getsentry/sentry-java/pull/6483)) - Android: Count deep sleep in breadcrumb, screenshot and view hierarchy debounce windows, so the first low-memory or battery breadcrumb after a long Doze is no longer dropped ([#6590](https://github.com/getsentry/sentry-java/pull/6590)) From 9d20df8d1504edd338ce44ee663c88692f829470 Mon Sep 17 00:00:00 2001 From: Markus Hintersteiner Date: Tue, 17 Nov 2026 09:40:12 +0100 Subject: [PATCH 4/4] test(replay): Run unit tests on Compose UI 1.12 and 1.13 as build-type unit test tasks --- .github/workflows/replay-compose-matrix.yml | 66 --------------------- sentry-android-replay/build.gradle.kts | 28 +++++---- 2 files changed, 18 insertions(+), 76 deletions(-) delete mode 100644 .github/workflows/replay-compose-matrix.yml diff --git a/.github/workflows/replay-compose-matrix.yml b/.github/workflows/replay-compose-matrix.yml deleted file mode 100644 index 9ee826ef4a1..00000000000 --- a/.github/workflows/replay-compose-matrix.yml +++ /dev/null @@ -1,66 +0,0 @@ -name: Replay Compose Matrix - -# Session Replay calls Compose internals. Runs the replay unit tests against the last five Compose UI -# minor versions, so a renamed internal fails here instead of silently unmasking Compose content in -# apps. 1.9 is the oldest version the test composables can run on. -on: - push: - branches: - - main - pull_request: - paths: - - 'sentry-android-replay/**' - - 'gradle/libs.versions.toml' - - '.github/workflows/replay-compose-matrix.yml' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - replay-compose-matrix: - timeout-minutes: 30 - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - compose-ui: [ '1.9.5', '1.10.6', '1.11.4', '1.12.1', '1.13.0-rc01' ] - - name: Replay - Compose UI ${{ matrix.compose-ui }} - - steps: - - name: Checkout Repo - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - - name: Setup Java Version - uses: actions/setup-java@77dd5b2ce225ea11469928ac317850245a74ae78 # v6.2.0 - with: - distribution: 'temurin' - java-version: '21' - - - name: Setup Gradle - uses: gradle/actions/setup-gradle@8da46b539cd8fe6ab27ca75128919a18d757604c # v6.4.1 - - - name: Run replay unit tests - run: ./gradlew :sentry-android-replay:testReleaseUnitTest -PreplayTestComposeUiVersion=${{ matrix.compose-ui }} - - - name: Upload test results - if: always() - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7 - with: - name: test-results-replay-compose-${{ matrix.compose-ui }} - path: | - sentry-android-replay/build/reports/* - - - name: Test Report - uses: phoenix-actions/test-reporting@7317eea6e13c47348dd0bb318669485157c518d6 # pin@v16 - if: always() - with: - name: JUnit Replay Compose UI ${{ matrix.compose-ui }} - list-suites: 'failed' - list-tests: 'failed' - path: | - sentry-android-replay/build/test-results/**/*.xml - reporter: java-junit - output-to: step-summary - fail-on-error: false diff --git a/sentry-android-replay/build.gradle.kts b/sentry-android-replay/build.gradle.kts index e8cc1424f42..d0d101d1908 100644 --- a/sentry-android-replay/build.gradle.kts +++ b/sentry-android-replay/build.gradle.kts @@ -1,3 +1,5 @@ +import com.android.build.api.variant.HasHostTestsBuilder +import com.android.build.api.variant.HostTestBuilder import io.gitlab.arturbosch.detekt.Detekt import org.jetbrains.kotlin.gradle.dsl.JvmTarget import org.jetbrains.kotlin.gradle.dsl.KotlinVersion @@ -16,6 +18,10 @@ plugins { id("io.sentry.robolectric") } +// Session Replay calls Compose internals, whose mangled JVM names change between Compose versions. +// Creating extra build types to run tests against the latest stable, and latest preview version. +val composeUiTestVersions = mapOf("composeUi112" to "1.12.1", "composeUi113" to "1.13.0-rc01") + android { compileSdk = libs.versions.compileSdk.get().toInt() compileSdkMinor = libs.versions.compileSdkMinor.get().toInt() @@ -37,6 +43,12 @@ android { buildTypes { getByName("debug") { consumerProguardFiles("proguard-rules.pro") } getByName("release") { consumerProguardFiles("proguard-rules.pro") } + composeUiTestVersions.keys.forEach { name -> + create(name) { + initWith(getByName("release")) + matchingFallbacks += "release" + } + } } // AGP 9 only generates unit tests for the testBuildType. The debug variant is @@ -73,6 +85,9 @@ android { androidComponents.beforeVariants { it.enable = !Config.Android.shouldSkipDebugVariant(it.buildType) + if (it.buildType in composeUiTestVersions) { + (it as HasHostTestsBuilder).hostTests[HostTestBuilder.UNIT_TEST_TYPE]?.enable = true + } } } @@ -102,19 +117,12 @@ dependencies { testImplementation(libs.coil.compose) } -// Runs the unit tests against another androidx.compose.ui version than the one they compile -// against, e.g. -PreplayTestComposeUiVersion=1.13.0-rc01, the same as an app that ships a newer -// Compose than the SDK was built with. Versions older than the test dependencies (Compose 1.9) -// don't -// work, as the test composables need a newer runtime. -providers.gradleProperty("replayTestComposeUiVersion").orNull?.let { composeUiVersion -> +composeUiTestVersions.forEach { (buildType, version) -> configurations - .matching { it.name.endsWith("UnitTestRuntimeClasspath") } + .matching { it.name == "${buildType}UnitTestRuntimeClasspath" } .configureEach { resolutionStrategy.eachDependency { - if (requested.group == "androidx.compose.ui") { - useVersion(composeUiVersion) - } + if (requested.group == "androidx.compose.ui") useVersion(version) } } }