-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
error: method setPermissionDelegate in class HealthConnectPermissionDelegate cannot be applied to given types #81
Comments
In Java I call the setPermissionDelegate method like this: On Android 14 it works fine but for others it crushes |
Same issue |
same issue also with java project |
This worked for me but as mentioned only for Android14 |
Working in 14 version and for other version crash. The method does not work. It does not prompt for permission on version 13, but it works fine on version 14. version: [email protected] import { requestPermission } from 'react-native-health-connect'; |
I'll investigate this after I am back from the vacation. |
In Android 14, it works fine, but it doesn’t work on versions lower than 14. I’ve granted all permissions for Android Health Connect, but the app doesn’t read data from Health Connect on these older versions. However, it works without issues in Android 14. The requestPermission method isn’t working on versions lower than 14. Could anyone help me figure out how to fix this? |
in MainActivity.java - changing this - using React native - 0.71.7, |
@darshan2911, add the following code to your Android Manifest file:
Additionally, create a new file called PermissionsRationaleActivity.java in the java folder with the following content:
PermissionsRationaleActivity File: Use this version of Health Connect: [email protected] It works fine on Android 14, but not on lower versions. I have already mentioned the issue here: #81 (comment) |
@mujeeb98, still not working in Android 14 - i am having pop up of permission in every version of Android but response after Allowing permission for requestPermission method i am not getting in Android 14, getting in lower versions |
@ismaelaarab i guess you are working with expo - i am working with react native CLI so i need some other solution. |
Hey everyone, Can someone clarify of what's happening here? Is the solution in documentation doesn't work on Android 14 or on Android 13 or lower? |
Solution in Documentation working fine in newer react native version for all the Android versions, i am currently having problem in React native - 0.71.7, |
Based on this PR that is picked for RN 71, you should be able to use it without any problems. https://github.com/facebook/react-native/releases/tag/v0.71.16 As mentioned here you need to have the latest patch of RN 71 and above: So please upgrade your React Native version to latest patch version of 0.71. |
@matinzd My application has the following setup: react-native: 0.71.18 |
Also,my app is not functioning on lower versions, but it works fine on Android 14. The requestPermission method returns an empty array when called. All my libraries are up to date, yet the issue persists. |
Please follow the documentation. Use RN 71 and above with latest patch. Follow all the docs and see if it works. |
However, the app functions correctly on Android version 14 . When requesting permission using the Health Connect permission API , the permission modal appears as expected. However, upon requesting permission on lower Android versions, the API returns an empty error response. This occurs even after downloading the Health Connect app. |
Yeah this isn't working on Android 13 |
Can you share the your |
@matinzd here is the code :
|
Yes @Satyam-shm I am also following the library code but it is not working on Android 13 or lower devices. @matinzd Can you please help us out? |
Android 14 success Android 9 Failed on requestPermission
|
This is the error am getting
as per installation guide I have made change on my
MainActivity.java
as my project is on javaon import part I added
import dev.matinzd.healthconnect.permissions.HealthConnectPermissionDelegate;
and replaced
onCreate()
method with thisand also on my android studio I can see an error on same thing
Non-static method 'setPermissionDelegate(error.NonExistentClass, java.lang.String)' cannot be referenced from a static context
Environment:
The text was updated successfully, but these errors were encountered: