Skip to content

RUM-16470: Support Android API 37 - #3550

Draft
kikoveiga wants to merge 1 commit into
developfrom
kikoveiga/rum-16470/target-api-37
Draft

RUM-16470: Support Android API 37#3550
kikoveiga wants to merge 1 commit into
developfrom
kikoveiga/rum-16470/target-api-37

Conversation

@kikoveiga

@kikoveiga kikoveiga commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Targets Android API 37 and pulls the whole toolchain forward to match: AGP 8.13.29.2.1, Kotlin 2.0.212.3.20 (language/API level pinned to 2.1 for now), detekt 1.23.82.0.0-alpha.6 (new dev.detekt coordinates), Gradle 9.4.09.5.1, and Android Build Tools/Lint/compileSdk/targetSdk 3637.

Key changes:

  • Java 17 everywhere: all library modules now compile with sourceCompatibility/targetCompatibility 17 (previously 11); dropped the now-unused java11() helper.
  • AGP 9 API migration: replaced deprecated sourceSets.srcDir/androidLint config with the new LibraryAndroidComponentsExtension/HostTestBuilder variant APIs; unit tests are now explicitly enabled per-variant since AGP 9 no longer enables them by default.
  • detekt 2.x migration: new dev.detekt:* artifacts, detekt.yml schema changes (thresholdallowed*, with a value-shift), and a full rewrite of our custom rules from the old K1 BindingContext API to the Kotlin Analysis API (KaType-based instead of KotlinType-based).
  • unmock 0.9.00.11.0 (required for detekt 2.x task classpath compatibility).
  • SQLDelight 1.5.5 (com.squareup.sqldelight) → 2.3.2 (app.cash.sqldelight), including the new SQLite 3.24 dialect dependency; updated all generated extension/transaction call sites.
  • Cronet 141.7340.3143.7445.0, which gives cronet-api and cronet-shared distinct manifest packages — this removes the R8 -dontwarn/detached-configuration workarounds that were previously needed to avoid duplicate-class conflicts between the two AARs.
  • kspTesting: switched from the unmaintained kotlin-compile-testing-ksp to dev.zacsweers.kctfork:ksp (0.12.1), needed for Kotlin 2.3 support.
  • Removed the spek test engine (long unused) from the JUnit Platform config.
  • Other dependency bumps for Kotlin 2.3 / AGP 9 compatibility: Apollo 4.3.34.4.3, coroutines 1.4.21.10.2, jUnitMockitoExt 5.4.05.12.0 (now pinned in lockstep with mockitoAndroid, see note below), androidLint 31.0.232.2.1.
  • CI: unified GRADLE_USER_HOME across all GitLab jobs to $CI_PROJECT_DIR/cache so every Gradle invocation shares one cacheable location.

Motivation

Google requires new Play Store submissions/updates to target a recent API level; API 37 support needs to land before that deadline. Since AGP 9 is a prerequisite for API 37 support, and AGP 9 drops several deprecated APIs we relied on, this became a combined toolchain upgrade (AGP, Kotlin, detekt, Gradle, and the libraries whose old versions were incompatible with the new stack).

Additional Notes

  • jUnitMockitoExt and mockitoAndroid must be kept in the same version: both pull in mockito-core, Gradle resolves to the higher of the two, and mockito-android ships the on-device MockMaker matched to that exact mockito-core version. A drift here doesn't fail the build — it silently breaks mocking at runtime on-device, which manifests as every batch upload getting dropped in reliability:core-it until tests time out. This was root-caused during this migration and is now called out inline in libs.versions.toml.
  • Kotlin languageVersion/apiVersion are pinned at 2.1 rather than jumping straight to 2.3 — this cushions the migration and is a safe intermediate step.
  • The kotlinAndroidPlugin classpath alias was removed from the root build.gradle.kts (dead code, AGP already brings it in via buildSrc).
  • Detekt custom rules (ThreadSafety, UnsafeThirdPartyFunctionCall, InvalidStringFormat, etc.) were rewritten against the Kotlin Analysis API — behavior should be equivalent, but the underlying type-resolution mechanism changed, so these are worth a closer look in review.

@datadog-official

datadog-official Bot commented Jun 17, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🔄 Datadog retried 4 tests - 4 passed on retry View in Datadog

🎯 Code Coverage (details)
Patch Coverage: 59.47%
Overall Coverage: 71.21% (-1.61%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: cb9b8f9 | Docs | Datadog PR Page | Give us feedback!

@kikoveiga
kikoveiga force-pushed the kikoveiga/rum-16470/target-api-37 branch 14 times, most recently from 52436b6 to 77a48f1 Compare June 19, 2026 10:38
@kikoveiga kikoveiga changed the title RUM-16370: Support Android API 37 RUM-16470: Support Android API 37 Jun 19, 2026
@kikoveiga
kikoveiga force-pushed the kikoveiga/rum-16470/target-api-37 branch 4 times, most recently from 657b11e to 2325560 Compare June 19, 2026 13:45
@kikoveiga kikoveiga closed this Jun 19, 2026
@kikoveiga
kikoveiga force-pushed the kikoveiga/rum-16470/target-api-37 branch from 2325560 to d4b6be3 Compare June 19, 2026 13:46
@kikoveiga kikoveiga reopened this Jun 19, 2026
@kikoveiga
kikoveiga force-pushed the kikoveiga/rum-16470/target-api-37 branch 4 times, most recently from 2b83c9b to ddf8ae2 Compare June 19, 2026 18:18
@codecov-commenter

codecov-commenter commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 79.06977% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.07%. Comparing base (36202ff) to head (cb9b8f9).

Files with missing lines Patch % Lines
.../android/profiling/internal/ProfilingDataWriter.kt 0.00% 2 Missing ⚠️
...ndroid/trace/opentelemetry/internal/OtelContext.kt 33.33% 1 Missing and 1 partial ⚠️
...android/trace/internal/DatadogPropagationHelper.kt 0.00% 2 Missing ⚠️
...ebview/internal/replay/WebViewReplayEventMapper.kt 71.43% 0 Missing and 2 partials ⚠️
...nternal/recorder/listener/WindowsOnDrawListener.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3550      +/-   ##
===========================================
- Coverage    73.12%   73.07%   -0.06%     
===========================================
  Files         1001     1001              
  Lines        36647    36629      -18     
  Branches      6346     6340       -6     
===========================================
- Hits         26798    26763      -35     
- Misses        8032     8048      +16     
- Partials      1817     1818       +1     
Files with missing lines Coverage Δ
...src/main/kotlin/com/datadog/android/DatadogSite.kt 100.00% <100.00%> (ø)
...atadog/android/core/configuration/Configuration.kt 98.13% <100.00%> (-0.94%) ⬇️
.../android/flags/openfeature/DatadogFlagsProvider.kt 88.89% <100.00%> (+0.25%) ⬆️
...in/com/datadog/android/flags/FlagsConfiguration.kt 86.05% <100.00%> (ø)
...n/com/datadog/android/flags/_FlagsInternalProxy.kt 0.00% <ø> (ø)
...tadog/android/flags/internal/DatadogFlagsClient.kt 92.22% <ø> (-0.64%) ⬇️
...lags/internal/repository/DefaultFlagsRepository.kt 67.27% <ø> (-1.15%) ⬇️
.../src/main/kotlin/com/datadog/android/log/Logger.kt 98.31% <ø> (ø)
...otlin/com/datadog/android/log/LogsConfiguration.kt 100.00% <100.00%> (ø)
...atadog/android/profiling/ProfilingConfiguration.kt 100.00% <ø> (ø)
... and 34 more

... and 129 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kikoveiga
kikoveiga force-pushed the kikoveiga/rum-16470/target-api-37 branch 2 times, most recently from 84e7652 to 2db1d19 Compare June 19, 2026 19:31
@kikoveiga
kikoveiga force-pushed the kikoveiga/rum-16470/target-api-37 branch 5 times, most recently from c9b8b17 to 52d8bd8 Compare June 28, 2026 18:50
@kikoveiga
kikoveiga force-pushed the kikoveiga/rum-16470/target-api-37 branch from 52d8bd8 to b47d85e Compare June 29, 2026 13:31
@kikoveiga kikoveiga added the v4 The PR should wait for the release of Android SDK v4 label Jul 1, 2026
@kikoveiga
kikoveiga force-pushed the kikoveiga/rum-16470/target-api-37 branch 2 times, most recently from 14b252e to dc2f4d1 Compare July 9, 2026 09:19
@kikoveiga kikoveiga self-assigned this Jul 9, 2026
@kikoveiga
kikoveiga force-pushed the kikoveiga/rum-16470/target-api-37 branch 4 times, most recently from 0e5e076 to bc19009 Compare July 20, 2026 14:09
@kikoveiga
kikoveiga force-pushed the kikoveiga/rum-16470/target-api-37 branch 2 times, most recently from b8dee64 to 3d227c4 Compare July 26, 2026 17:18
@kikoveiga
kikoveiga force-pushed the kikoveiga/rum-16470/target-api-37 branch 2 times, most recently from 01a7ce9 to 84d8e17 Compare July 29, 2026 10:23
@kikoveiga
kikoveiga force-pushed the kikoveiga/rum-16470/target-api-37 branch 10 times, most recently from 670bf2d to 5543e9c Compare August 10, 2026 15:06
@kikoveiga
kikoveiga force-pushed the kikoveiga/rum-16470/target-api-37 branch from 5543e9c to cb9b8f9 Compare August 13, 2026 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v4 The PR should wait for the release of Android SDK v4

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants