Skip to content

feat(android): Compile against Android SDK 37#5723

Draft
runningcode wants to merge 3 commits into
mainfrom
no/verify-android-37
Draft

feat(android): Compile against Android SDK 37#5723
runningcode wants to merge 3 commits into
mainfrom
no/verify-android-37

Conversation

@runningcode

@runningcode runningcode commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Ref: JAVA-631

📜 Description

Compile the Android SDK against API 37 (Android 17) by bumping compileSdk and targetSdk from 36 to 37 in gradle/libs.versions.toml.

This also fixes a compilation break the new SDK surfaces: in the API 37 android.jar, MediaCodecInfo.CodecCapabilities.getVideoCapabilities() is now annotated @Nullable. SimpleVideoEncoder dereferenced it without a null check, which fails Kotlin compilation. The access is already wrapped in a try/catch, so adding the null guard keeps behavior unchanged.

💡 Motivation and Context

Verify the SDK builds and behaves correctly against the latest Android SDK so downstream apps can compile/target API 37 without issues.

Verified against API 37 on this branch: full SDK + sample assemble, clean lint (AGP 8.13.1), R8 full-mode release build (no missing rules, runs clean), external app consuming the published artifacts, and runtime coverage on an API 37 emulator (crashes, ANRs incl. native, Session Replay h264 encoding — the exact SimpleVideoEncoder path — messages, and profiling), all landing in Sentry.

💚 How did you test it?

  • ./gradlew assemble + sample assembleRelease/assembleDebug against compileSdk/targetSdk 37
  • lintRelease on core Android modules — no issues
  • R8 full-mode release APK installed and smoke-tested on an Android 17 (API 37) emulator
  • Consumed the publishToMavenLocal artifacts from a standalone external app
  • Exercised the sample app end-to-end on API 37 and confirmed events (incl. Session Replay video encoding) arrive in Sentry

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

  • Add API 37 to the CI emulator matrix once tooling is broadly available.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against e007f1c

@runningcode runningcode force-pushed the no/verify-android-37 branch from 804d9ed to b85ca7b Compare July 6, 2026 12:26
@sentry

sentry Bot commented Jul 6, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.47.0 (1) release

⚙️ sentry-android Build Distribution Settings

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 317.04 ms 350.94 ms 33.89 ms
Size 0 B 0 B 0 B

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
4c04bb8 350.71 ms 413.63 ms 62.92 ms
bb0ff41 315.84 ms 350.76 ms 34.92 ms
7c1a728 289.46 ms 368.15 ms 78.69 ms
ff8eea4 313.42 ms 337.08 ms 23.66 ms
bbc35bb 298.53 ms 372.17 ms 73.64 ms
91bb874 311.00 ms 363.47 ms 52.47 ms
abfcc92 337.38 ms 427.39 ms 90.00 ms
ae7fed0 293.84 ms 380.22 ms 86.38 ms
3998a95 415.94 ms 478.54 ms 62.60 ms
d15471f 307.28 ms 381.85 ms 74.57 ms

App size

Revision Plain With Sentry Diff
4c04bb8 0 B 0 B 0 B
bb0ff41 0 B 0 B 0 B
7c1a728 0 B 0 B 0 B
ff8eea4 1.58 MiB 2.28 MiB 718.64 KiB
bbc35bb 1.58 MiB 2.12 MiB 553.01 KiB
91bb874 1.58 MiB 2.13 MiB 559.07 KiB
abfcc92 1.58 MiB 2.13 MiB 557.31 KiB
ae7fed0 1.58 MiB 2.12 MiB 551.77 KiB
3998a95 1.58 MiB 2.10 MiB 532.96 KiB
d15471f 1.58 MiB 2.13 MiB 559.54 KiB

Previous results on branch: no/verify-android-37

Startup times

Revision Plain With Sentry Diff
b69d15d 332.52 ms 453.75 ms 121.23 ms

App size

Revision Plain With Sentry Diff
b69d15d 0 B 0 B 0 B

@linear-code

linear-code Bot commented Jul 6, 2026

Copy link
Copy Markdown

JAVA-631

@runningcode runningcode force-pushed the no/verify-android-37 branch 3 times, most recently from 4eaa43f to d35a1d5 Compare July 7, 2026 16:20
runningcode and others added 3 commits July 8, 2026 09:14
Bump compileSdk and targetSdk to 37 (Android 17).

Also handle the now-nullable MediaCodecInfo.getVideoCapabilities() in SimpleVideoEncoder: the API 37 android.jar annotates it @nullable, which otherwise fails Kotlin compilation. The access is already inside a try/catch, so behavior is unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
API 37 ships as a minor-versioned platform (android-37.0). Install it
explicitly in the AGP compatibility matrix before building the release
APK so the platform can be resolved.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@runningcode runningcode force-pushed the no/verify-android-37 branch from f0c3a94 to e007f1c Compare July 8, 2026 07:15
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