Skip to content

Target JVM 11 bytecode instead of 17 - #209

Merged
aleksandar-apostolov merged 1 commit into
developfrom
fix/stream-result-jvm-target-11
Aug 7, 2026
Merged

Target JVM 11 bytecode instead of 17#209
aleksandar-apostolov merged 1 commit into
developfrom
fix/stream-result-jvm-target-11

Conversation

@aleksandar-apostolov

Copy link
Copy Markdown
Contributor

Fixes AND-1372

🎯 Goal

stream-result has emitted JVM 17 bytecode since 1.3.3 (the 2024-09-30 "Use Java Version 17" sweep). Kotlin can't inline JVM-17 inline functions (Result.map/flatMap, Error helpers) into a JVM-11 compilation, so JVM-11 consumers fail to compile — blocking stream-chat-android on any bump past 1.3.2 (surfaced wiring the AND-1367 bump to 1.4.0).

Every Stream product SDK is JVM 11 — Chat, Core, Feeds, and Video (the released stream-video-android-core-1.29.0.aar is Java 11 bytecode) — and nothing ever consumed the JVM-17 builds, so lowering the target realigns stream-result with all of its consumers.

🛠 Implementation details

  • Revert sourceCompatibility/targetCompatibility and kotlinOptions.jvmTarget from 17 back to 11 across all modules (build.gradle.kts, stream-result, stream-result-call, stream-result-call-retrofit, app).
  • JDK 17 build toolchain unchanged — only the emitted bytecode target is lowered. 11 is the compatible floor: JVM-17 consumers can still use an 11 library.
  • No source changes; stream-result is commonMain KMP with zero dependencies, so nothing requires Java 17.
  • Version is not bumped here (release-owned); the next release carries this plus the GenericError.code slot already on develop.

🧪 Testing

  • ./gradlew apiCheck spotlessCheck pass across all modules.
  • Verified the emitted bytecode: compiled Error.class is class major version 55 (Java 11) — was 61 (Java 17) in 1.4.0.

☑️Contributor Checklist

General

  • I have signed the Stream CLA (required)
  • Assigned a person / code owner group (required)
  • Thread with the PR link started in a respective Slack channel (required)

Revert sourceCompatibility/targetCompatibility and kotlinOptions.jvmTarget
from 17 back to 11 across all modules (undoing the 2024 "Use Java Version
17" sweep). stream-result emitted JVM 17 bytecode since 1.3.3, which JVM 11
consumers cannot inline its inline functions from — breaking stream-chat
(JVM 11) on any bump past 1.3.2.

Targeting 11 is the compatible floor: consumable by both JVM 11 (Chat) and
JVM 17 (Video) modules. The JDK 17 build toolchain is unchanged; only the
emitted bytecode target is lowered.
@aleksandar-apostolov
aleksandar-apostolov marked this pull request as ready for review August 7, 2026 08:41
@aleksandar-apostolov
aleksandar-apostolov merged commit 8dcd767 into develop Aug 7, 2026
4 checks passed
@aleksandar-apostolov
aleksandar-apostolov deleted the fix/stream-result-jvm-target-11 branch August 7, 2026 09:29
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.

2 participants