You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
open the App again and it crashes on this line if (results[0] == PackageManager.PERMISSION_GRANTED) {
Expected Behavior
Check results array before accessing it.
instead of if (results[0] == PackageManager.PERMISSION_GRANTED) {
something like if (results.length > 0 && results[0] == PackageManager.PERMISSION_GRANTED) {
Actual Behavior
On some devices app crashes after Requesting a permission on Android. App crashed on Xiaomi Redmi 4 Prime(Android 6.0.1), Lenovo C2 (Android 6.0), Sony Xperia Z3Compact (Android 6.0.1), Samsung Galaxy A3 (Android 7.0.). App is not crashing on Huawei P10 lite(Android 7) or Sony Xperia L1(Android 7). After crash, the app is restarted.
Reproducible Demo
(Paste the link to an example project and exact instructions to reproduce the issue.)
The text was updated successfully, but these errors were encountered:
Summary:
Reported in Issue #15928
Fixing bug when permission showing dialog and user go to home and re-open minimized app.
1. Ask for permission
2. Minimize app (Press HomeButton)
3. Open app again via shortcut
[ANDROID] [BUGFIX] [PermissionsModule.java] - Fixed bug when asked for permission Cause: java.lang.ArrayIndexOutOfBoundsException · length=0; index=0
Closes#16507
Differential Revision: D6133708
Pulled By: shergin
fbshipit-source-id: 9c05d1d5d16fedf718ad5113df69a4df3af62013
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions.
stalebot
added
the
Stale
There has been a lack of activity on this issue and it may be closed soon.
label
Dec 23, 2017
Is this a bug report?
Yes
Have you read the Contributing Guidelines?
Yes
Environment
react-native -v
: 0.45.1node -v
: 7.9.0npm -v
: 4.2.0yarn --version
: 0.23.2Then, specify:
Steps to Reproduce
if (results[0] == PackageManager.PERMISSION_GRANTED) {
Expected Behavior
Check results array before accessing it.
instead of
if (results[0] == PackageManager.PERMISSION_GRANTED) {
something like
if (results.length > 0 && results[0] == PackageManager.PERMISSION_GRANTED) {
Actual Behavior
On some devices app crashes after Requesting a permission on Android. App crashed on Xiaomi Redmi 4 Prime(Android 6.0.1), Lenovo C2 (Android 6.0), Sony Xperia Z3Compact (Android 6.0.1), Samsung Galaxy A3 (Android 7.0.). App is not crashing on Huawei P10 lite(Android 7) or Sony Xperia L1(Android 7). After crash, the app is restarted.
Reproducible Demo
(Paste the link to an example project and exact instructions to reproduce the issue.)
The text was updated successfully, but these errors were encountered: