Remove unused dependencies; enforce the Gson version floor with a constraint#1945
Merged
Conversation
Six on-device Compose tests used the deprecated v1
`androidx.compose.ui.test.junit4.createComposeRule` behind a
`@Suppress("DEPRECATION")`, because the v2 rule's default
`StandardTestDispatcher` broke the `onGloballyPositioned` ->
`LaunchedEffect` -> `animateScrollTo` chains in EtaStrip/SlideBox when
#1792 was filed.
Route all six through a shared `createUnconfinedComposeRule()` helper
that calls the non-deprecated `v2.createComposeRule(...)` and pins
composition to an `UnconfinedTestDispatcher` via its `effectContext`
parameter, reproducing the old eager-execution semantics without any
deprecation suppression.
Investigated the original blocker: on the current stack
(compose-ui-test 1.11.4) plain v2 with StandardTestDispatcher now passes
all six tests on-device too — the rule's reworked waitUntil/idle
machinery pumps the dispatcher — so there is no upstream bug left to
file. Unconfined is retained only because SlideBoxTest is an @smoketest
on the API 23 floor emulator whose StandardTestDispatcher timing is
unvalidated.
Also correct a stale BOM version comment in build.gradle.kts
(2026.05.00/1.11.2 -> 2026.06.01/1.11.4).
Verified: androidTest compiles clean under -PwarningsAsErrors=true, and
all 12 tests across the six classes pass on-device (Pixel 7 Pro).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… commons-lang3, concurrent-futures) None of these are referenced in app source, resources, or the manifest: - androidx.fragment:fragment-ktx — no Fragment subclasses remain; the app is fully Activity + Compose. - androidx.cardview:cardview — replaced by Compose Card; only doc-comment mentions of the legacy CardView remained. - androidx.constraintlayout:constraintlayout — no app:layout_constraint* in any XML and no imports; layout is Compose. - org.apache.commons:commons-lang3 — zero references (commons-io is still used and is kept). - androidx.concurrent:concurrent-futures + concurrent-listenablefuture (+ -callback) — a ListenableFuture pin for WorkManager with no direct usage; the build's checkDuplicateClasses + dex merge pass without it, confirming it was not resolving a Guava/ListenableFuture conflict. gson is intentionally kept: it has no call sites but is a deliberate version pin forcing a transitive Gson up off 2.8.5 (see the comment at its dependency line). Verified with assembleObaGoogleDebug -PwarningsAsErrors=true (green). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…dency The Gson version floor was expressed by declaring `implementation(libs.gson)` even though no app source references Gson — an unused library on the classpath standing in for a version requirement. Replace it with a dependency constraint, which floors the version only where Gson actually appears (transitively) without adding it as a direct dependency. Also corrects the stale rationale: Gson is not pulled in at 2.8.5. It arrives at 2.10.1 via firebase-firestore -> io.grpc:grpc-core, which is already past the 2.8.9 CVE-2022-25647 fix. The constraint floors that transitive up to the catalog version (2.14.0) so a future grpc/Firebase bump can't drag it back down. Resolution is unchanged: gson still resolves to 2.14.0 (now marked `(c)` / "By constraint" in dependencyInsight, no longer a direct edge), and assembleObaGoogleDebug is UP-TO-DATE, so the packaged APK is byte-identical. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (9)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThe PR removes unused Gradle catalog entries, updates dependency constraints and the Compose BOM, adds a shared unconfined Compose test rule, and migrates seven UI tests from the deprecated Compose rule. ChangesDependency and Compose test updates
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related issues
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Drops external dependencies that aren't referenced anywhere in app source, resources, or the manifest, and replaces the Gson "version pin via unused dependency" hack with a proper dependency constraint.
This came out of an audit that cross-referenced every catalog coordinate against real usage — necessary because neither the Kotlin compiler nor Android Lint flags an unused dependency (they analyze code correctness, not build-graph reachability), so this dead weight is invisible to the normal CI gates.
Removed (unused)
androidx.fragment:fragment-ktxFragmentsubclasses remain; app is fully Activity + Compose.androidx.cardview:cardviewCard; only doc-comment mentions of the legacyCardViewremained.androidx.constraintlayout:constraintlayoutapp:layout_constraint*in any XML, no imports; layout is Compose.org.apache.commons:commons-lang3commons-iois used and is kept.)androidx.concurrent:concurrent-futures+concurrent-listenablefuture(+-callback)ListenableFuturepin for WorkManager with no direct usage. The build'scheckDuplicateClasses+ dex merge pass without it, confirming it was not resolving a Guava/ListenableFutureconflict.Gson: constraint instead of a phantom dependency
Gson had no call sites but was declared
implementation(libs.gson)purely to force a transitive copy up. That's an unused library standing in for a version requirement. Replaced with a dependency constraint that floors the version only where Gson actually appears (transitively viafirebase-firestore → io.grpc:grpc-core) without adding it to the classpath.The old rationale was also stale: Gson isn't pulled in at 2.8.5 — it arrives at 2.10.1, already past the 2.8.9 CVE-2022-25647 fix. The constraint now honestly documents that it floors the transitive up to the catalog version (2.14.0) as forward protection against a future grpc/Firebase downgrade, not as a live-vuln patch.
Resolution is unchanged: Gson still resolves to 2.14.0 (now
(c)/ "By constraint" independencyInsight, no longer a direct edge).Verification
assembleObaGoogleDebug -PwarningsAsErrors=true→BUILD SUCCESSFUL(green, no new warnings), including resource merge,checkDuplicateClasses, and dex merge.UP-TO-DATE, so the packaged APK is byte-identical — a behavior-preserving refactor.obaGooglevariant locally; CI covers the rest of the grid + lint.🤖 Generated with Claude Code
Summary by CodeRabbit
Refactor
Tests