Remove unused androidx.lifecycle dependency#64
Conversation
The lifecycle-runtime-ktx dependency was added in the initial project skeleton and has never been used by any SDK code. Exporting it in the POM at version 2.11.0 forced consumers with androidx.lifecycle Compose artifacts on their classpath up to 2.11.0 via androidx version alignment, which requires compileSdk 37 and AGP 9.2+. The sample app keeps its own lifecycle-runtime-ktx dependency for lifecycleScope, so the version catalog entry remains. Fixes GitHub issue #63. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 25 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe SDK no longer declares the unused AndroidX Lifecycle runtime KTX dependency. A new ChangesLifecycle dependency removal
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 |
An audit of declared dependencies against actual usage found: - device-sdk: kotlinx-coroutines-android (only Dispatchers.IO is used), junit 4, and turbine were never referenced by any source file. The CLAUDE.md testing notes incorrectly claimed Turbine was in use. - sample: core-ktx is not used, and the junit / androidx.test.ext:junit test dependencies had no test sources to serve. - version catalog: kotlin-reflect was defined but referenced by no build file; the junit and turbine entries are orphaned by the above. Verified with :device-sdk:build (tests, detekt, ktlint) and :sample:assembleDebug. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR trims unused dependencies from the Android SDK and related modules to avoid exporting unnecessary constraints in the published device-sdk POM—specifically removing the unused androidx.lifecycle:lifecycle-runtime-ktx dependency that caused AndroidX lifecycle version alignment issues for consumers.
Changes:
- Removed unused runtime dependencies from
device-sdk(lifecycle-runtime-ktx,kotlinx-coroutines-android) to slim the published dependency graph. - Removed unused/testing-only dependencies and catalog entries (
junit4,turbine,kotlin-reflect) and updated the testing bundle accordingly. - Added a 0.3.1 changelog entry and updated internal contributor docs (CLAUDE.md) to reflect current test tooling.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| sample/build.gradle.kts | Removes unused sample app dependencies (core-ktx, test deps). |
| gradle/libs.versions.toml | Removes unused catalog versions/libs and updates the testing bundle. |
| device-sdk/build.gradle.kts | Removes unused device-sdk runtime deps to reduce exported POM constraints. |
| CLAUDE.md | Updates documentation to remove the claim that Turbine is used. |
| CHANGELOG.md | Adds 0.3.1 entry documenting the dependency removals and consumer impact. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -1,5 +1,17 @@ | |||
| # Changelog | |||
|
|
|||
| ## 0.3.1 (TBD) | |||
Fixes #63. Linear: STF-1158
Summary
device-sdkhas depended onandroidx.lifecycle:lifecycle-runtime-ktxsince the initial project skeleton, but no SDK code has ever used a lifecycle API (the SDK manages its own coroutine scope viaSupervisorJob+Dispatchers.IO). The dependency was exported in the published POM, and after 0.3.0 bumped it to 2.11.0, androidx version alignment forced consumers with anyandroidx.lifecycleCompose artifacts on their classpath up to 2.11.0 — whose Compose artifacts require compileSdk 37 / AGP 9.2+ per the androidx Lifecycle release notes.This removes the dependency from
device-sdkand adds a changelog entry for a 0.3.1 patch release. The version catalog entry stays because the sample app useslifecycleScopeand declares its own dependency.Follow-up: other unused dependencies
A broader audit of declared vs. actually-used dependencies (second commit) also removes:
kotlinx-coroutines-android(onlyDispatchers.IOis used; the artifact exists to provideDispatchers.Main), and the unusedjunit4 andturbinetest dependencies. CLAUDE.md's stale claim that Turbine is used is corrected.core-ktx, plusjunit/androidx.test.ext:junittest dependencies with no test sources to serve.kotlin-reflectentry and the orphanedjunit/turbineentries.None of these change SDK behavior; the only consumer-visible effect is a slimmer POM.
Verification
./gradlew :device-sdk:build(unit tests, detekt, ktlint) passes./gradlew :sample:assembleDebugpasses./gradlew :device-sdk:japicmpagainst the released 0.3.0 AAR passes (ABI no-op):device-sdk:dependenciesshows remaining transitive lifecycle constraints (viaandroidx.core) at 2.6.2, so no compileSdk 37 pressure on consumers🤖 Generated with Claude Code