Remove androidx.core:core-ktx and prepare 0.3.1 release#65
Conversation
|
Warning Review limit reached
Next review available in: 40 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 (6)
📝 WalkthroughWalkthroughThe PR removes AndroidX Core KTX, replaces its ChangesAndroidX Core KTX removal
Estimated code review effort: 2 (Simple) | ~10 minutes 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@CHANGELOG.md`:
- Around line 14-19: Update the changelog entry near the removed core-ktx
dependency to limit the AndroidX claim to SDK implementation/runtime
dependencies, since device-sdk/build.gradle.kts still declares AndroidX test
dependencies and uses the AndroidX runner. Preserve the dependency-removal and
compileSdk/AGP details while removing or revising the assertion that the SDK has
no AndroidX dependencies.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 7fdb3184-7a75-4bfc-949f-372b7e20cf35
📒 Files selected for processing (5)
CHANGELOG.mdREADME.mddevice-sdk/build.gradle.ktsdevice-sdk/src/main/java/com/maxmind/device/storage/StoredIDStorage.ktgradle/libs.versions.toml
💤 Files with no reviewable changes (2)
- gradle/libs.versions.toml
- device-sdk/build.gradle.kts
| - Removed the `androidx.core:core-ktx` dependency. Its only use was the | ||
| `SharedPreferences.edit {}` extension, which has been replaced with the | ||
| equivalent framework calls. The SDK now has no `androidx` dependencies at all, | ||
| so it no longer participates in androidx version alignment and imposes no | ||
| `compileSdk` or Android Gradle Plugin floor on consumers. Previously | ||
| `core-ktx` 1.18.0 required `compileSdk` 36 and AGP 8.9.1. |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "Files:"
git ls-files | rg '(^|/)CHANGELOG\.md$|build\.gradle\.kts$|settings\.gradle\.kts$' || true
echo
echo "CHANGELOG snippet:"
if [ -f CHANGELOG.md ]; then sed -n '1,40p' CHANGELOG.md | cat -n; fi
echo
echo "Gradle AndroidX dependency references:"
rg -n --hidden -S "androidx\.|androidx" -g 'build.gradle.kts' -g 'settings.gradle.kts' . || true
echo
echo "device-sdk build.gradle.kts relevant deps:"
if [ -f device-sdk/build.gradle.kts ]; then sed -n '1,220p' device-sdk/build.gradle.kts | cat -n; fiRepository: maxmind/device-android
Length of output: 11753
Narrow the AndroidX dependency claim in the changelog.
device-sdk/build.gradle.kts still declares AndroidX dependencies for androidTestImplementation (androidx.test.junit and androidx.test.core) and uses the AndroidX runner. Say the SDK’s implementation/runtime dependencies no longer include AndroidX, or remove the remaining AndroidX test dependencies if that is the intended scope.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@CHANGELOG.md` around lines 14 - 19, Update the changelog entry near the
removed core-ktx dependency to limit the AndroidX claim to SDK
implementation/runtime dependencies, since device-sdk/build.gradle.kts still
declares AndroidX test dependencies and uses the AndroidX runner. Preserve the
dependency-removal and compileSdk/AGP details while removing or revising the
assertion that the SDK has no AndroidX dependencies.
There was a problem hiding this comment.
Taken, with a scoping fix rather than removing the claim — the wording was imprecise, though the consumer-facing substance was already correct.
You're right that device-sdk still declares AndroidX: testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" plus androidTestImplementation on androidx.test.ext:junit and androidx.test:core. So "the SDK now has no androidx dependencies at all" was wrong read as a statement about the Gradle module.
It was not wrong about what consumers inherit. Those are test-only configurations and are not published — the released 0.3.0 POM contains no test dependencies at all, only the runtime set (kotlin-stdlib, coroutines-core, serialization-json, core-ktx, and the five ktor modules). So the version-alignment and compileSdk/AGP-floor claims hold as written; only the scope of the "no androidx" sentence was too broad.
Changed to:
The published artifact now has no
androidxdependencies, so it no longer participates in androidx version alignment and imposes nocompileSdkor Android Gradle Plugin floor on consumers.
That is the claim consumers care about, and it is verifiable: :device-sdk:dependencies --configuration releaseRuntimeClasspath now returns zero androidx entries.
Squashed into the original commit (e1fcf5f) rather than left as a separate fixup, since this branch hasn't had human review yet.
— Claude, on behalf of @oschwald
The SDK's only androidx usage was the SharedPreferences.edit {} extension
in StoredIDStorage. That extension is inline and compiles to exactly
edit() / mutate / apply(), so calling the framework methods directly is
behaviorally identical. StoredIDStorageTest already mocked the raw
framework calls and asserted apply(), so it passes unchanged.
Removing it means the published POM no longer exports any androidx
artifact, so the SDK is out of androidx version alignment entirely and
imposes no compileSdk or AGP floor on consumers. core-ktx 1.18.0
declared minCompileSdk 36 / minAndroidGradlePluginVersion 8.9.1, and the
queued 1.19.0 bump declares 37 / 9.1.0 -- the same shape of consumer
breakage reported in GitHub #63. This removes that class of problem
rather than re-evaluating it on each core-ktx release.
Verified with :device-sdk:build (328 tests, lint), detekt, ktlintCheck,
and :sample:assembleDebug. releaseRuntimeClasspath now contains no
androidx entries.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The project's first release was in 2025 and it is still being changed in 2026, so a range rather than a single year. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Linear: STF-1165
Summary
Pre-release work for 0.3.1 that
./dev-bin/release.shdoes not handle itself. Three self-contained commits:androidx.core:core-ktx— the SDK's last androidx dependency.README.dev.mdstep 6; the script only rewrites the version string).CHANGELOG.md— the script parses this heading and hard-fails unless the date is today.Why remove core-ktx
#63 is already fixed by the
androidx.lifecycleremoval in #64: the reporter was on compileSdk 36 / AGP 8.13.1, and 2.11.0 forced them to 37. What remained was latent rather than live —core-ktx1.18.0 declaresminCompileSdk=36/minAndroidGradlePluginVersion=8.9.1in its AAR metadata, which is at or below what the reporter runs and identical to the floor 0.2.0 already shipped via 1.17.0.The problem is recurrence. The queued 1.19.0 bump (#56) declares 37 / 9.1.0 — the same consumer break as #63, arriving through a different androidx artifact. Rather than re-litigating that on every
core-ktxrelease, this drops the dependency entirely. Its only use was the inlineSharedPreferences.edit {}extension, which compiles to exactlyedit()/ mutate /apply(), so it was replaced with the equivalent framework calls. The published POM now exports no androidx artifact at all, so the SDK is out of androidx version alignment and imposes no compileSdk or AGP floor on consumers.StoredIDStorageTestalready mocked the raw framework calls and assertedapply(), so it passes unchanged — no test edits were needed.#56 has been closed as moot. #59 (AGP 9.3.0) is deliberately still open: it needs a Gradle wrapper bump to 9.5.0+ first and warrants its own evaluation after this release.
Verification
./gradlew :device-sdk:build— 328 tests, 0 failures;StoredIDStorageTest6/6 unchanged in both debug and release variants./gradlew detekt ktlintCheck— pass (note these are not wired intocheck, sobuildalone does not run them)./gradlew :sample:assembleDebug— pass./gradlew :device-sdk:dependencies --configuration releaseRuntimeClasspath— no androidx entries; the shipped graph is kotlin-stdlib, coroutines-core, serialization-json and the five ktor modulesUseKtxfinding against the rewritten callsBefore merging
Per
README.dev.md, run./dev-bin/release.shon this branch first — it appends a "Preparing for 0.3.1" commit and pushes, which will land in this PR. If the release slips past 2026-07-24, amend the release-date commit first or the script will refuse to run.🤖 Generated with Claude Code
Summary by CodeRabbit
Compatibility
Documentation