flutter-plugins icon indicating copy to clipboard operation
flutter-plugins copied to clipboard

[health 9.0.1] No virtual method getStartZoneOffset

Open tomassasovsky opened this issue 11 months ago • 8 comments

Device / Emulator and OS

Please complete the following information for each phone and/or emulator you're experiencing this bug on:

  • Device: Samsung Galaxy S23 Ultra
  • OS: Android 14

Describe the bug

When including HealthDataType.DISTANCE_DELTA in the requested data types for the function getHealthDataFromTypes, I get the following error:

Fatal Exception: java.lang.NoSuchMethodError: No virtual method getStartZoneOffset()Lj$/time/ZoneOffset; in class Landroid/health/connect/datatypes/DistanceRecord; or its super classes (declaration of 'android.health.connect.datatypes.DistanceRecord' appears in /apex/com.android.healthfitness/javalib/framework-healthfitness.jar)
       at androidx.health.connect.client.impl.platform.records.RecordConvertersKt.toSdkDistanceRecord(RecordConverters.kt:11)
       at androidx.health.connect.client.impl.platform.records.RecordConvertersKt.toSdkRecord(RecordConverters.kt:143)
       at androidx.health.connect.client.impl.HealthConnectClientUpsideDownImpl.readRecords(HealthConnectClientUpsideDownImpl.java:112)
       at androidx.health.connect.client.impl.HealthConnectClientUpsideDownImpl$readRecords$1.invokeSuspend(HealthConnectClientUpsideDownImpl.java:12)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(BaseContinuationImpl.java:11)
       at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.java:93)
       at android.os.Handler.handleCallback(Handler.java:958)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loopOnce(Looper.java:230)
       at android.os.Looper.loop(Looper.java:319)
       at android.app.ActivityThread.main(ActivityThread.java:8893)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:608)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)

Flutter doctor

$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.19.1, on Microsoft Windows [Version 10.0.22631.3155], locale en-US)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.6.4)
[√] Android Studio (version 2022.2)
[√] VS Code (version 1.87.0)
[√] Connected device (4 available)
[√] Network resources

• No issues found!

tomassasovsky avatar Mar 02 '24 02:03 tomassasovsky

I have the same issue with HealthDataType.STEPS. Did you find any solution?

thaliachitziou99 avatar Mar 21 '24 08:03 thaliachitziou99

I did not, no. This is still happening to me.

tomassasovsky avatar Apr 04 '24 18:04 tomassasovsky

Now happening to me with:

E/AndroidRuntime( 5722): FATAL EXCEPTION: main
E/AndroidRuntime( 5722): Process: ai.visionbox.genomii.dev, PID: 5722
E/AndroidRuntime( 5722): java.lang.NoSuchMethodError: No virtual method getStartZoneOffset()Lj$/time/ZoneOffset; in class Landroid/health/connect/datatypes/ActiveCaloriesBurnedRecord; or its super classes (declaration of 'android.health.connect.datatypes.ActiveCaloriesBurnedRecord' appears in /apex/com.android.healthfitness/javalib/framework-healthfitness.jar)
E/AndroidRuntime( 5722): 	at androidx.health.connect.client.impl.platform.records.RecordConvertersKt$$ExternalSyntheticAPIConversion75.m(R8$$SyntheticClass:0)
E/AndroidRuntime( 5722): 	at androidx.health.connect.client.impl.platform.records.RecordConvertersKt.toSdkActiveCaloriesBurnedRecord(RecordConverters.kt:167)
E/AndroidRuntime( 5722): 	at androidx.health.connect.client.impl.platform.records.RecordConvertersKt.toSdkRecord(RecordConverters.kt:122)
E/AndroidRuntime( 5722): 	at androidx.health.connect.client.impl.HealthConnectClientUpsideDownImpl.readRecords(HealthConnectClientUpsideDownImpl.kt:198)
E/AndroidRuntime( 5722): 	at androidx.health.connect.client.impl.HealthConnectClientUpsideDownImpl$readRecords$1.invokeSuspend(HealthConnectClientUpsideDownImpl.kt:0)
E/AndroidRuntime( 5722): 	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
E/AndroidRuntime( 5722): 	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
E/AndroidRuntime( 5722): 	at android.os.Handler.handleCallback(Handler.java:958)
E/AndroidRuntime( 5722): 	at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 5722): 	at android.os.Looper.loopOnce(Looper.java:230)
E/AndroidRuntime( 5722): 	at android.os.Looper.loop(Looper.java:319)
E/AndroidRuntime( 5722): 	at android.app.ActivityThread.main(ActivityThread.java:8893)
E/AndroidRuntime( 5722): 	at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 5722): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:608)
E/AndroidRuntime( 5722): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
E/AndroidRuntime( 5722): 	Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@27d8c6f, Dispatchers.Main]
I/Process ( 5722): Sending signal. PID: 5722 SIG: 9

tomassasovsky avatar Apr 04 '24 19:04 tomassasovsky

I have the same issue with HealthDataType.STEPS. Did you find any solution?

Same problem on Galaxy A34 Android 14

vladyslavalisov avatar May 07 '24 12:05 vladyslavalisov

same problem

  • health 10.2.0
  • galaxy s21
  • android 14

lien-dkseo avatar May 10 '24 01:05 lien-dkseo

fixed. in my case... using 'com.android.tools:desugar_jdk_libs:1.2.2'

dependencies {
    coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2'
}

to

dependencies {
    coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.3'
}

lien-dkseo avatar May 13 '24 00:05 lien-dkseo