algolia / algolia/instantsearch-android

Update Kotlinx-datetime to 0.8.0

Open
#437 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
159
Forks
32
Avg merge
7d 22h
Merged PRs (30d)
2

Description

**Describe the bug 🐛**
Instantsearch-Android has a hard dependency on kotlinx-datetime 0.7.x, however when adding kotlinx-datetime 0.8.x to our app it crashes.

**To Reproduce 🔍**
Steps to reproduce the behavior:
1. Add `implementation("com.algolia:instantsearch-android:4.0.1")` (4.1.0 behaves identically).
2. Make sure something else in the graph pulls mainline `kotlinx-datetime:0.8.0` — any recent
KMP-based SDK will do. Confirm with `./gradlew :app:dependencyInsight --configuration
debugRuntimeClasspath --dependency kotlinx-datetime`, which should report `0.8.0` selected
over `0.7.1-0.6.x-compat`.
3. Build and run, then construct a client: `SearchClient(appId, apiKey)`.
4. See error — it crashes immediately, before any search call:

java.lang.NoClassDefFoundError: Failed resolution of: Lkotlinx/datetime/Clock$System;
at com.algolia.client.transport.internal.TimeKt.currentTimeMillis(Time.kt:6)
at com.algolia.client.transport.internal.RetryableHost.(RetryableHost.kt:27)
at com.algolia.client.transport.internal.KtorRequester.(KtorRequester.kt:40)
at com.algolia.client.transport.internal.RequesterKt.requesterOf-jETwo_I(Requester.kt:47)
at com.algolia.client.api.SearchClient.(SearchClient.kt:28)
Caused by: java.lang.ClassNotFoundException: Didn't find class "kotlinx.datetime.Clock$System"

**Expected behavior 💭**
No crash

**Environment:**
- OS: Android (reproduced on an API 37 / Android 17 arm64 emulator)
- Library Version: `instantsearch-android` 4.0.1 **and** 4.1.0;
- Toolchain: AGP 8.13.2, Gradle 8.14.4, Kotlin 2.3.20

Contributor guide

Open the contributing guide

Research direction

Start by running the reported dependencyInsight command and inspect the kotlinx-datetime version selected by the app. Trace the failure through Time.kt, RetryableHost, KtorRequester, Requester.kt, and SearchClient, then verify the client can be constructed without the NoClassDefFoundError using the reported Android setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
build-system, mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
70/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.