android / health-samples

Apache License 2.0
244 stars 138 forks source link

App crashing when navigating to session details #249

Open denlig opened 2 months ago

denlig commented 2 months ago
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

breanatate commented 2 months ago

Yes, same issue! We've removed Speed aggregation from the sample in the interim. Thanks for reporting!