Enable Java 8+ API desugaring for API 24/25 support (Sentry COLUMBA-8M)#854
Enable Java 8+ API desugaring for API 24/25 support (Sentry COLUMBA-8M)#854torlando-tech wants to merge 1 commit into
Conversation
Greptile SummaryThis PR fixes a
Confidence Score: 5/5Safe to merge — this is a well-scoped, mechanical build-config change that fixes a confirmed production crash with no logic changes. All three Android modules correctly get No files require special attention. The Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
subgraph JVM["Pure JVM - no desugaring needed"]
domain[":domain java-library"]
micron[":micron kotlin jvm"]
end
subgraph Android["Android modules - isCoreLibraryDesugaringEnabled = true"]
reticulum[":reticulum android-library"]
data[":data android-library"]
app[":app com.android.application"]
end
subgraph Upstream["reticulum-kt JitPack JARs"]
rnscore["rns-core-v0.0.16 - 8 LocalDateTime refs"]
rnsinterfaces["rns-interfaces-v0.0.16 - 20 LocalDateTime refs"]
end
rnscore -->|api| reticulum
rnsinterfaces -->|api| reticulum
reticulum -->|implementation| app
data -->|implementation| app
domain -->|implementation| data
domain -->|implementation| app
micron -->|implementation| app
Reviews (2): Last reviewed commit: "Enable Java 8+ API desugaring for API 24..." | Re-trigger Greptile |
Sentry COLUMBA-8M: NoClassDefFoundError: java.time.LocalDateTime on
Android 7.x devices (API 24/25). The crash fires the moment Transport
.registerDestination touches a method whose signature references
LocalDateTime — for the captured user this was identity import via the
deep link /identity_manager?base32Key={...}, but any code path that
registers a destination would crash identically.
Root cause: reticulum-kt's public API surface uses java.time.* (8 refs
in rns-core, 20 in rns-interfaces). java.time was added in API 26.
Columba's minSdk is 24 across all Android modules, but no module had
coreLibraryDesugaring configured.
Enable isCoreLibraryDesugaringEnabled and add the desugar_jdk_libs
dependency in all three Android modules (app, reticulum, data). The
domain and micron modules are pure JVM and don't need it.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
d790689 to
8b2a449
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Summary
Fixes Sentry COLUMBA-8M —
NoClassDefFoundError: java.time.LocalDateTimeon Android 7.x devices (API 24/25).Captured stack:
```
java.lang.NoClassDefFoundError: Failed resolution of: Ljava/time/LocalDateTime;
at network.reticulum.transport.Transport.log(Transport.kt:5697)
at network.reticulum.transport.Transport.registerDestination(Transport.kt:874)
at network.reticulum.destination.Destination$Companion.create(Destination.kt:845)
at NativeReticulumProtocol.buildIdentityResult(NativeReticulumProtocol.kt:1018)
at NativeReticulumProtocol$importIdentityFile$2.invokeSuspend(NativeReticulumProtocol.kt:983)
Caused by: ClassNotFoundException: java.time.LocalDateTime
```
For the captured user this fired during identity import via the deep link `/identity_manager?base32Key={...}`, but any code path that registers a destination would crash identically.
Root cause
Upstream `reticulum-kt`'s public API references `java.time.LocalDateTime` (verified by grepping the cached jars: 8 refs in `rns-core-v0.0.12.jar`, 20 in `rns-interfaces-v0.0.12.jar`). `java.time.*` was only added to the Android runtime in API 26.
Columba's `minSdk` is 24 in every Android module, but `coreLibraryDesugaring` was not configured anywhere — zero hits across all `build.gradle.kts` files. So on API 24/25 the class loader trips the moment `Transport` touches a `LocalDateTime`-bearing method.
Fix
Enable Java 8+ API desugaring in the three Android modules (`app`, `reticulum`, `data`) and add `desugar_jdk_libs` 2.1.5 as a `coreLibraryDesugaring` dependency in each. The `domain` and `micron` modules are pure JVM (`java-library` / `kotlin("jvm")`) and don't need it.
```kotlin
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
isCoreLibraryDesugaringEnabled = true
}
```
```kotlin
dependencies {
coreLibraryDesugaring(libs.android.desugar.jdk.libs)
}
```
Affected scope
Test plan
Notes
🤖 Generated with Claude Code