fix(mobile): correct play-services-ads pin to 25.2.0 (API + Kotlin 2.1) - #345
Conversation
#344 pinned play-services-ads to 25.0.0, which compiles under Kotlin 2.1 but predates the AgeRestrictedTreatment API that react-native-google-mobile-ads 16.3.3 references, so :react-native-google-mobile-ads:compileReleaseKotlin then failed with "Unresolved reference 'AgeRestrictedTreatment'". The catch: that API and the Kotlin 2.3 metadata bump both landed in 25.3.0, so no single ads release has the API under Kotlin 2.1 — except 25.2.0, the release right before the bump. It carries the API and is still Kotlin 2.1. Verified by compiling the exact failing task locally against each candidate: - 25.0.0 -> Unresolved reference 'AgeRestrictedTreatment' - 25.3.0 -> Kotlin metadata 2.3.0 vs expected 2.1.0 - 25.2.0 -> BUILD SUCCESSFUL Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
There was a problem hiding this comment.
Code Review: PR #345
Scope: PR #345 — fix(mobile): correct play-services-ads pin to 25.2.0 (API + Kotlin 2.1)
Recommendation: APPROVE
Summary
A surgical one-file change that updates the play-services-ads resolution pin from 25.0.0 to 25.2.0 in the Android build plugin and updates the accompanying Gradle because string to match. The fix correctly threads the needle between the AgeRestrictedTreatment API availability (first present in 25.2.0) and the Kotlin 2.3 metadata incompatibility (first present in 25.3.0), making 25.2.0 the sole viable version. No rubric dimensions are violated.
Findings
Critical
None
High
None
Medium
None
Low / Info
None
Subagents
| Agent | Verdict |
|---|---|
| parity-checker | N/A — change is Android build infrastructure only; no apps/web/** or apps/mobile/** app code touched |
| i18n-syncer | N/A — no user-facing strings or locale files changed |
| contract-aligner | N/A — no packages/shared/src/types/* or endpoints.ts changed |
| security-reviewer | N/A — no orbit-api code changed |
Validation
| Check | Result |
|---|---|
| Lint | N/A — no TypeScript/JS app source changed |
| Type check | N/A — no TypeScript source changed |
| Tests | N/A — no logic changed; build plugin is not unit-tested |
| Build (api) | N/A — backend not touched |
Deferred — N/A dimensions & files not verdicted
- Parity (#9): Surface not touched — change is a build plugin, not a mobile app feature; web has no Android build system.
- i18n (#10): Surface not touched — no user-facing strings.
- Contract drift + backward-compat (#11): Surface not touched — no
packages/sharedtypes or API contracts changed. - DESIGN.md / AI-slop (#8): Gated — no
apps/*UI files changed. - Backend hard rules (#13): Gated — no
orbit-apicode changed. - Security (#12): No security-relevant code paths changed; dependency resolution strategy is a standard Gradle force-resolution pattern.
- Build verification: Cannot re-run the Android AAB build in CI from this review context; the PR body documents the local compilation results (25.0.0 → unresolved reference, 25.3.0 → metadata mismatch, 25.2.0 → BUILD SUCCESSFUL in 31s).
What's good
- The PR body is exemplary: presents a clear compatibility matrix, identifies the precise failure mode for each version, and provides exact build output as evidence — making the fix trivially verifiable.
- The
details.becausestring is updated to precisely explain the dual constraint (Kotlin metadata AND API availability), which will be invaluable when this file is revisited for a future SDK upgrade. - The change is minimal and surgical — exactly one constant and one string, nothing over-engineered.
- Correctly follows up #344's partial fix rather than introducing a new workaround mechanism.
Recommendation
Approve and merge. After merge, re-dispatch the Android Release workflow as noted in the PR body (open track, app_version 1.3.15, versionCode 74, clear_cache true).
|
… compat) (#346) The Android Release workflow installs with `npm install --package-lock=false`, so it ignores the committed lockfile and re-resolves ranges. `^16.3.2` then floated to 16.4.0, whose Kotlin references AgeRestrictedTreatment — an API that only exists in play-services-ads 25.3.0+, which is also where Google bumped the SDK to Kotlin 2.3 metadata that the Expo SDK 55 (Kotlin 2.1) toolchain cannot read. So no ads version satisfies 16.4.0 under Kotlin 2.1: 16.4.0 + ads <=25.2.0 -> Unresolved reference 'AgeRestrictedTreatment' 16.4.0 + ads >=25.3.0 -> metadata is 2.3.0, expected version is 2.1.0 16.3.3 is the last release that does not use that API, so it compiles against the 25.2.0 ads pin (#345) under Kotlin 2.1. Pin it exactly so CI stops floating. Local is unaffected (already on 16.3.3); the lockfile already resolved 16.3.3, so only the dependency spec changes. Verified by a full local release build (all native modules + :app): BUILD SUCCESSFUL, app-release.apk produced. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>



Follow-up to #344
#344 pinned
play-services-adsto 25.0.0 to dodge the Kotlin 2.3 metadata in25.4.0. That cleared the Kotlin error — but25.0.0predates theAgeRestrictedTreatmentAPI thatreact-native-google-mobile-ads@16.3.3references, so the next AAB build failed with:The squeeze
Empirically (by compiling
:react-native-google-mobile-ads:compileReleaseKotlinagainst each version):The API and the Kotlin-2.3 bump both landed in 25.3.0, so 25.2.0 is the only release that has the API while staying Kotlin-2.1 — the floor and ceiling collapse to one version.
Fix
Change the resolution pin in
with-android-release-build-fixesfrom25.0.0→25.2.0.play-services-ads-identifierstays excluded.Verification (local, exact failing task)
After merge, re-dispatch the Android Release workflow (open track, app_version 1.3.15, versionCode 74, clear_cache true).
🤖 Generated with Claude Code