Skip to content

fix(mobile): correct play-services-ads pin to 25.2.0 (API + Kotlin 2.1) - #345

Merged
thomasluizon merged 1 commit into
mainfrom
fix/play-services-ads-pin-25-2-0
Jun 28, 2026
Merged

fix(mobile): correct play-services-ads pin to 25.2.0 (API + Kotlin 2.1)#345
thomasluizon merged 1 commit into
mainfrom
fix/play-services-ads-pin-25-2-0

Conversation

@thomasluizon

Copy link
Copy Markdown
Owner

Follow-up to #344

#344 pinned play-services-ads to 25.0.0 to dodge the Kotlin 2.3 metadata in 25.4.0. That cleared the Kotlin error — but 25.0.0 predates the AgeRestrictedTreatment API that react-native-google-mobile-ads@16.3.3 references, so the next AAB build failed with:

e: ReactNativeGoogleMobileAdsModule.kt:28:35 Unresolved reference 'AgeRestrictedTreatment'

The squeeze

Empirically (by compiling :react-native-google-mobile-ads:compileReleaseKotlin against each version):

play-services-ads AgeRestrictedTreatment API Kotlin metadata compiles under Kotlin 2.1?
25.0.0 ❌ missing 2.1 ❌ unresolved reference
25.2.0 ✅ present 2.1 BUILD SUCCESSFUL
25.3.0 ✅ present 2.3 ❌ metadata 2.3.0 vs 2.1.0
25.4.0 ✅ present 2.3 ❌ metadata 2.3.0 vs 2.1.0

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-fixes from 25.0.025.2.0. play-services-ads-identifier stays excluded.

Verification (local, exact failing task)

useVersion '25.0.0' -> Unresolved reference 'AgeRestrictedTreatment'
useVersion '25.3.0' -> Module ... metadata is 2.3.0, expected version is 2.1.0
useVersion '25.2.0' -> BUILD SUCCESSFUL in 31s

After merge, re-dispatch the Android Release workflow (open track, app_version 1.3.15, versionCode 74, clear_cache true).

🤖 Generated with Claude Code

#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>
@vercel

vercel Bot commented Jun 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
orbit-ui-mobile-web Ignored Ignored Jun 28, 2026 2:26am

Request Review

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/shared types or API contracts changed.
  • DESIGN.md / AI-slop (#8): Gated — no apps/* UI files changed.
  • Backend hard rules (#13): Gated — no orbit-api code 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.because string 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).

@thomasluizon
thomasluizon merged commit 92086ba into main Jun 28, 2026
9 checks passed
@thomasluizon
thomasluizon deleted the fix/play-services-ads-pin-25-2-0 branch June 28, 2026 02:30
@sonarqubecloud

Copy link
Copy Markdown

thomasluizon added a commit that referenced this pull request Jun 28, 2026
… 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant