Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GET_RECORD_FAIL - permission problem only in production app #13

Open
Fudal opened this issue Jun 5, 2023 · 6 comments
Open

GET_RECORD_FAIL - permission problem only in production app #13

Fudal opened this issue Jun 5, 2023 · 6 comments

Comments

@Fudal
Copy link

Fudal commented Jun 5, 2023

When I'm using:

    final result = await HealthConnectFactory.getRecord(
      type: type,
      startTime: DateTime(2000),
      endTime: DateTime.now(),
    );

I have error:

PlatformException(GET_RECORD_FAIL, com.package.name lacks the following permissions: [android.permission.health.READ_BLOOD_PRESSURE], java.lang.SecurityException: com.package.name lacks the following permissions: [android.permission.health.READ_BLOOD_PRESSURE]
	at androidx.health.platform.client.impl.error.ErrorStatusConverterKt.toException(ErrorStatusConverter.kt:47)
	at androidx.health.platform.client.impl.ReadDataRangeCallback.onError(ReadDataRangeCallback.kt:35)
	at androidx.health.platform.client.service.IReadDataRangeCallback$Stub.onTransact(IReadDataRangeCallback.java:75)
	at android.os.Binder.execTransactInternal(Binder.java:1331)
	at android.os.Binder.execTransact(Binder.java:1268)
, null)

but that error is only in production app.

Of course my app has permissions in androidManifest:


    <uses-permission android:name="android.permission.health.READ_HEART_RATE"/>
    <uses-permission android:name="android.permission.health.READ_BLOOD_PRESSURE"/>
@Fudal
Copy link
Author

Fudal commented Jun 8, 2023

@duynguyen242 do you have any idea why that is happened?

@owjoh
Copy link

owjoh commented Jul 4, 2023

@Fudal did you ever figure out a fix for this?

@Fudal
Copy link
Author

Fudal commented Jul 4, 2023

@owjoh yes, probably - you need to fill that form https://docs.google.com/forms/d/1LFjbq1MOCZySpP5eIVkoyzXTanpcGTYQH26lKcrQUJo/viewform?edit_requested=true&pli=1 to have the access to Health Connect API data.

@owjoh
Copy link

owjoh commented Jul 4, 2023

@Fudal thanks for the response. Where did you find this form? I can't seem to find any docs that reference it

@Fudal
Copy link
Author

Fudal commented Jul 4, 2023

@owjoh I found that here: https://developer.android.com/guide/health-and-fitness/health-connect/get-started

@Fudal
Copy link
Author

Fudal commented Jul 28, 2023

@owjoh Did it work for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants