android / android/health-samples

App crashing when navigating to session details

Open
#249 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
346
Forks
183
PR merge metrics
No merged PRs in 30d

Description

```
com.example.healthconnectsample E FATAL EXCEPTION: main
Process: com.example.healthconnectsample, PID: 1721
java.lang.IllegalArgumentException: Unsupported aggregation type SpeedSeries_speed_avg
at androidx.health.connect.client.impl.platform.records.RequestConvertersKt.toAggregationType(RequestConverters.kt:141)
at androidx.health.connect.client.impl.platform.records.RequestConvertersKt.toPlatformRequest(RequestConverters.kt:104)
at androidx.health.connect.client.impl.HealthConnectClientUpsideDownImpl$aggregate$2.invokeSuspend(HealthConnectClientUpsideDownImpl.kt:207)
at androidx.health.connect.client.impl.HealthConnectClientUpsideDownImpl$aggregate$2.invoke(Unknown Source:8)
at androidx.health.connect.client.impl.HealthConnectClientUpsideDownImpl$aggregate$2.invoke(Unknown Source:2)
at androidx.health.connect.client.impl.HealthConnectClientUpsideDownImpl.wrapPlatformException(HealthConnectClientUpsideDownImpl.kt:347)
at androidx.health.connect.client.impl.HealthConnectClientUpsideDownImpl.aggregate(HealthConnectClientUpsideDownImpl.kt:204)
at com.example.healthconnectsample.data.HealthConnectManager.readAssociatedSessionData(HealthConnectManager.kt:246)
at com.example.healthconnectsample.data.HealthConnectManager$readAssociatedSessionData$1.invokeSuspend(Unknown Source:15)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
at android.os.Handler.handleCallback(Handler.java:958)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:205)
at android.os.Looper.loop(Looper.java:294)
at android.app.ActivityThread.main(ActivityThread.java:8194)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@b7f162, Dispatchers.Main.immediate]
```

I'm running Android 14, so it might be related to this issue? https://issuetracker.google.com/issues/327273591

Contributor guide

Open the contributing guide

Research direction

Start in HealthConnectManager.kt at readAssociatedSessionData, line 246, and inspect the SpeedSeries_speed_avg aggregation request against the linked Android 14 issue. Reproduce the crash by navigating to session details; done means that navigation no longer throws the unsupported aggregation exception and the details view loads.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.