English
While using Actifit on my Realme C75, I noticed the app wasn't loading any data from Health Connect. No steps, no activity — just empty screens.
I decided to dig deeper using ADB logcat and found this exception being thrown every time the app tried to sync:
java.lang.IllegalArgumentException: startTime must be before endTime.
at androidx.health.connect.client.records.StepsRecord.<init>
After investigation, I discovered the culprit: the Realme C75's native step counter writes records to Health Connect where startTime == endTime (zero duration). Health Connect accepts these records on write, but the Kotlin SDK rejects them on read — causing the entire coroutine to cancel and no data to load.
Workaround: Revoke the Realme system app's write permission for Steps in Health Connect and delete its existing records. After that, Actifit loads data normally.
Stay tuned for a detailed post with the full investigation!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Português
Enquanto usava o Actifit no meu Realme C75, percebi que o app não carregava nenhum dado do Health Connect. Sem passos, sem atividade — telas vazias.
Resolvi investigar usando ADB logcat e encontrei esta exceção sendo lançada toda vez que o app tentava sincronizar:
java.lang.IllegalArgumentException: startTime must be before endTime.
at androidx.health.connect.client.records.StepsRecord.<init>
Após investigação, descobri o culpado: o contador de passos nativo do Realme C75 grava registros no Health Connect onde startTime == endTime (duração zero). O Health Connect aceita esses registros na escrita, mas o SDK Kotlin os rejeita na leitura — cancelando toda a coroutine e impedindo qualquer dado de carregar.
Solução temporária: Revogar a permissão de escrita de Passos do app do Realme no Health Connect e deletar os registros existentes. Após isso, o Actifit carrega os dados normalmente.
Em breve um post detalhado com toda a investigação!