-
Notifications
You must be signed in to change notification settings - Fork 24.2k
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
PermissionsAndroid request crashes #16626
Comments
+1 I am having the exact same issue |
this is fixed with this commit: |
@SamMatthewsIsACommonName thanks so much but how can i upgrade react-native that refer to specific commit or tag when it is not release on NPM? |
@derakhshanfar I've been using 0.51.0-rc.2, |
@SamMatthewsIsACommonName Hi,I am having the exact same issue in 0.55.4 when I used PermissionsAndroid for Camera permission ,how do you fix this problem,please help me, Thanks! |
Is this a bug report?
Yes .
When we used PermissionsAndroid for Bluetooth permission in android we are getting crash as th
Have you read the Contributing Guidelines?
Yes
Environment
Steps to Reproduce
Android Permission in API Level (>=23) for BT using PermissionsAndroid.request API with rationale option.
Expected Behavior
Must show Alert Dialog if not granted earlier and return grant status
Actual Behavior
Not shown Alert Dialog and Throws Exception
(Write what happened. Add screenshots!)
Reproducible Demo
N/A
componentDidMount() {
this.requestBTPermission();
}
async requestBTPermission() {
try {
const granted = await PermissionsAndroid.request("android.permission.ACCESS_COARSE_LOCATION", {
'title': 'Turn On Bluetooth',
'message': 'App needs access to your bluetooth ' + 'to connected to CEC.'
});
Logs:
Caused by: java.lang.ArrayIndexOutOfBoundsException: length=0; index=0
07-16 10:43:40.786 10457 10457 E AndroidRuntime: at com.facebook.react.modules.permissions.PermissionsModule$1.invoke(PermissionsModule.java:119)
07-16 10:43:40.786 10457 10457 E AndroidRuntime: at com.facebook.react.modules.permissions.PermissionsModule.onRequestPermissionsResult(PermissionsModule.java:207)
07-16 10:43:40.786 10457 10457 E AndroidRuntime: at com.facebook.react.ReactActivityDelegate$1.invoke(ReactActivityDelegate.java:211)
07-16 10:43:40.786 10457 10457 E AndroidRuntime: at com.facebook.react.ReactActivityDelegate.onResume(ReactActivityDelegate.java:131)
07-16 10:43:40.786 10457 10457 E AndroidRuntime: at com.facebook.react.ReactActivity.onResume(ReactActivity.java:66)
07-16 10:43:40.786 10457 10457 E AndroidRuntime: at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1270)
07-16 10:43:40.786 10457 10457 E AndroidRuntime: at android.app.Activity.performResume(Activity.java:6824)
07-16 10:43:40.786 10457 10457 E AndroidRuntime: at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3470)
07-16 10:43:40.786 10457 10457 E AndroidRuntime: ... 8 more
The text was updated successfully, but these errors were encountered: