Skip to content

fix(android): allow older Kotlin compilers with ads SDK 25.4 - #866

Open
floze-the-genius wants to merge 2 commits into
invertase:mainfrom
floze-the-genius:fix/android-kotlin-metadata-compatibility
Open

fix(android): allow older Kotlin compilers with ads SDK 25.4#866
floze-the-genius wants to merge 2 commits into
invertase:mainfrom
floze-the-genius:fix/android-kotlin-metadata-compatibility

Conversation

@floze-the-genius

Copy link
Copy Markdown

Description

Google Mobile Ads 25.3+ embeds Kotlin 2.3 metadata even though this module only consumes its public Java API. That makes the library fail to compile in Expo and React Native projects still using Kotlin 2.1.x.

Configure only this library's KotlinCompile tasks to skip the dependency metadata version check. This preserves the Android AgeRestrictedTreatment API added with the newer SDK without forcing every consumer module to upgrade to Kotlin 2.3.

Related issues

Fixes #863

Release Summary

Allow Android projects using Kotlin 2.1.x to compile with Google Mobile Ads SDK 25.4.0.

Checklist

  • I read the Contributor Guide and followed the submission process.
    • Yes
  • My change supports the following platforms;
    • Android
    • iOS
  • My change includes tests;
    • e2e tests added or updated in __tests__e2e__
    • jest tests added or updated in __tests__
  • I have updated TypeScript types that are affected by my change.
  • This is a breaking change;
    • Yes
    • No

Test Plan

  • Reproduced the failure in a focused Gradle harness using Kotlin 2.1.0 and the exact play-services-ads:25.4.0 AAR classes.
  • Verified the same harness compiles after applying the scoped -Xskip-metadata-version-check configuration in Groovy.
  • yarn tests:jest --runInBand (7 suites passed, 79 tests passed)
  • yarn tsc:compile
  • yarn lint

A full Android example assemble was not run locally because this machine has no accepted Android SDK installation; the repository Android CI remains the end-to-end build check.

🔥

@CLAassistant

CLAassistant commented Jul 19, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ mikehardy
❌ floze-the-genius
You have signed the CLA already but the status is still pending? Let us recheck it.

@floze-the-genius
floze-the-genius force-pushed the fix/android-kotlin-metadata-compatibility branch from 481b12c to fa05a06 Compare August 9, 2026 14:41
….3.0, docs

- Pin example KOTLIN_VERSION to 2.1.0 so Ads 25.4 metadata path is exercised
- Gate -Xskip-metadata-version-check to Kotlin compilers older than 2.3
- Document Android Kotlin 2.1 / Ads 25.3+ compatibility options in index docs
@mikehardy mikehardy added the CLA: blocked needs CLA signed before merge label Aug 17, 2026

@mikehardy mikehardy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

thanks @floze-the-genius! clever fix for a problem that's sure to hit most folks at the moment. I added a quick follow-up and I'll be happy to merge if you can sign the CLA, thanks!

@codecov

codecov Bot commented Aug 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 39.35%. Comparing base (a34c7ba) to head (12b606c).
⚠️ Report is 246 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #866      +/-   ##
==========================================
- Coverage   43.72%   39.35%   -4.37%     
==========================================
  Files          30       36       +6     
  Lines         549      671     +122     
  Branches      151      172      +21     
==========================================
+ Hits          240      264      +24     
- Misses        309      407      +98     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mikehardy

Copy link
Copy Markdown
Collaborator

there is no problem merging this despite iOS build failing - it's failing for unrelated reasons

still need a CLA sign from @floze-the-genius though, otherwise we'll have to recreate this PR separately...

@mikehardy mikehardy added the workflow: pending merge Waiting on CI or question responses to merge, but otherwise ready label Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA: blocked needs CLA signed before merge workflow: pending merge Waiting on CI or question responses to merge, but otherwise ready

Projects

None yet

3 participants