Skip to content

Build on compileSdk/targetSdk 37 (Android 17): AGP 9.1 + Gradle 9.3 + Kotlin 2.2 - #1754

Closed
rahul-lohra wants to merge 5 commits into
developfrom
feature/rahullohra/build-on-sdk-37
Closed

Build on compileSdk/targetSdk 37 (Android 17): AGP 9.1 + Gradle 9.3 + Kotlin 2.2#1754
rahul-lohra wants to merge 5 commits into
developfrom
feature/rahullohra/build-on-sdk-37

Conversation

@rahul-lohra

@rahul-lohra rahul-lohra commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Goal

Raise compileSdk/targetSdk from 35 → 37 (Android 17). The installed platform is the stable, minor-versioned android-37.0, which the old toolchain (AGP 8.5.2) cannot even resolve (Failed to find Platform SDK … android-37). API 37 has a hard floor of AGP 9.1, and AGP 9 drops Kotlin 1.9 — so this is necessarily a full toolchain upgrade, not a one-line SDK bump.

Note: this PR depends on the GetStream/stream-build-conventions-android#70streamConventions must point at a published version that supports AGP 9 (currently 0.13.2-SNAPSHOT in the catalog; pin to the released version before merge).

Implementation

Toolchain Updates

Component From To Reason
compileSdk / targetSdk 35 37 Target Android 17
android.suppressUnsupportedCompileSdk 34 37 Match the new compileSdk
Android Gradle Plugin 8.5.2 9.1.1 Minimum for API 37 (9.0 caps at 36.1)
Gradle 8.8 9.3.1 Required by AGP 9.1
Kotlin 1.9.25 2.2.10 AGP 9 removes Kotlin 1.9 support
KSP 1.9.25-1.0.20 2.2.10-2.0.2 Match Kotlin 2.2.10
Compose Compiler Gradle plugin (org.jetbrains.kotlin.plugin.compose) not applied (legacy kotlinCompilerExtensionVersion) enabled Required on Kotlin 2.0+; replaces the legacy compiler-extension config

Dependency bumps forced by Gradle 9 / AGP 9

Dependency From To Reason
Wire 4.7.0 5.5.1 4.7 used the removed Gradle-internal FileOrUriNotationConverter
baseline-profile / benchmark 1.2.3 1.5.0-alpha07 Older versions can't resolve AGP 9's TestExtension
Hilt / Dagger 2.52 2.60.1 2.52's bytecode transform doesn't run under AGP 9
streamConventions (build-conventions plugin) 0.13.1 AGP-9-compatible build 0.13.1 calls block-DSLs removed from AGP 9's CommonExtension
stream-log-android 1.3.1 1.3.4 To fix shared namespace for io.getstream.log as AGP 9 gives hard error if two different libraries share same namespace

Build logic — build-logic/convention/ (AGP 9 DSL migration)

  • CommonExtension<*,*,*,*,*,*> → non-generic CommonExtension everywhere
  • Removed block-DSLs → getter/property access (buildFeatures.compose, lint.abortOnError, productFlavors container)
  • KotlinAndroid.kt: kotlinOptionscompilerOptions (the old DSL is a hard error under -Werror)
  • AndroidCompose.kt: apply the Compose plugin, stabilityConfigurationFiles, dropped kotlinCompilerExtensionVersion

Build scripts (Gradle 9 / AGP 9 API removals)

  • Root build.gradle.kts: kotlinOptionscompilerOptions; Project.exec { cp … }File.copyTo (removed in Gradle 9)
  • settings.gradle.kts: dropped removeUnusedEntriesAfterDays (removed in Gradle 9)
  • core + benchmark: managedDevices.devicesmanagedDevices.localDevices
  • core: buildDirlayout.buildDirectory; packaging.exclude()resources.excludes.add(); srcDir(Provider) → concrete File
  • demo-app: buildConfigFields?.put (now nullable in AGP 9); toLowerCase()lowercase()

Source Code Changes (Kotlin 2.2 strictness)

  • StreamVideoClient.kt: LruCache(maxSize = 100)LruCache(100) (named args prohibited on Java functions)
  • PermissionManager.kt: dropped inline on stored constructor vals (inline property can't have a backing field)
  • ForegroundServicePermissionManager.kt: hardcoded 37Build.VERSION_CODES.CINNAMON_BUN (constant now available at compileSdk 37)

Public API

  • Regenerated .api baselines for core and ui-compose (binary-compatibility-validator) to reflect Kotlin-2.2 signature changes.

🎨 UI Changes

None

Testing

  • CLI compilation of every module against SDK 37: core, ui-core, ui-xml, ui-compose, filters-video, previewdata, demo-app (development/debug incl. Hilt KSP), all four tutorials/*, and metrics.
  • Not yet run (recommend before merge): full unit-test suite (testDebugUnitTest), apiCheck, spotlessCheck, and an on-device smoke test of the demo app on an Android 17 device/emulator — especially the incoming-call ringtone path touched by the CINNAMON_BUN change.
  • ⚠️ IDE note: syncing this branch needs an Android Studio build that supports AGP 9.1 (2026+); older Studios fail sync with a Library … null model error. CLI/CI is unaffected.

@rahul-lohra rahul-lohra self-assigned this Jul 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

PR checklist ❌

The following issues were detected:

  • Missing required label: at least one label starting with pr:.

What we check

  1. Title is concise (5–18 words) unless labeled pr:ignore-for-release.
  2. At least one pr: label exists (e.g., pr:bug, pr:new-feature).
  3. Sections ### Goal, ### Implementation, and ### Testing contain content. Bot-authored PRs are exempt.
  4. PR description references an issue (Linear ticket like AND-123, a Linear URL, or a GitHub Closes #N). Bot-authored PRs are exempt.

Update stream log library to fix namespace issue
Adjust sourc code changes for adopting kotlin 2.2
Build on sdk 37
@rahul-lohra
rahul-lohra force-pushed the feature/rahullohra/build-on-sdk-37 branch from 5835587 to b35031f Compare July 28, 2026 08:36
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