-
Notifications
You must be signed in to change notification settings - Fork 1.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
Crash when denying run-time permission for location access in NearbyActivity #861
Comments
@Bluesir9 Interesting, it crashes for you EVERY time? Just to be clear, which version are you testing - the production release, the beta release, or the current master branch? Yeah, I was undecided on creating a whole new Fragment just for the error message, but the suggestions at #707 swayed me. :) I would personally not mind the use of a dialog instead. What do the others think? |
@misaochan So actually the crash was obtained initially when I built from an outdated master. So I pulled fresh changes and built it and tried it again. And the crash persists and happens every time I hit the deny button on the run-time permission dialog. Replacing the fragment with a dialog would be simple enough but yeah lets hear from the others as well. |
@Bluesir9 If you don't mind, could you please try installing the version on Google Play and see if it crashes for you as well? If it doesn't, then we know that the problem lies with one of the pre-release changes. Thanks! |
just tried it on the play store version and it crashed there as well. |
Ah, okay, thanks. We definitely need to bump this up priority-wise, then. |
Of course. If we are decided on the Dialog route as a fix, then I could take this up. Will be a quick one anyways. |
So, @Bluesir9 IIRC you're taking this up (assuming that you could take that thumbs up symbol as an acknowledgement)? |
@sivaraam yes |
@Bluesir9 I guess somebody should assign this task to you to avoid it being showing from the task that has no asignee. |
I think @Bluesir9 has fixed this? The PR should ideally link to the issue next time though. :) |
Yeah this has been fixed and merged. PR in question -> #866 |
Thanks @Bluesir9 ! |
@Bluesir9 Is this fixed on current Google Play version? I am new here, I just downloaded the app and I run into this crash. Environment: HTC 10, Android Oreo, version 2.7.1 from GP |
@TGar21 Yes please create a new issue, thanks for your feedback! |
Created #1581 (but I realized now, that it is something else probably) |
@TGar21 The stacktraces of the 2 crashes look different. The crash you encountered is caused because of calling "getLatitude" on a null "Location" object. So yeah, creating a new issue was the right thing to do. |
I am encountering the following crash when I deny the run-time permission for location access when I hit the NearbyActivity
java.lang.RuntimeException: Failure delivering result ResultInfo{who=@android:requestPermissions:, request=1, result=-1, data=Intent { act=android.content.pm.action.REQUEST_PERMISSIONS (has extras) }} to activity {fr.free.nrw.commons/fr.free.nrw.commons.nearby.NearbyActivity}: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState at android.app.ActivityThread.deliverResults(ActivityThread.java:3699) at android.app.ActivityThread.handleSendResult(ActivityThread.java:3742) at android.app.ActivityThread.-wrap16(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1393) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) Caused by: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState at android.support.v4.app.FragmentManagerImpl.checkStateLoss(FragmentManager.java:1842) at android.support.v4.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:1860) at android.support.v4.app.BackStackRecord.commitInternal(BackStackRecord.java:650) at android.support.v4.app.BackStackRecord.commit(BackStackRecord.java:609) at fr.free.nrw.commons.nearby.NearbyActivity.onRequestPermissionsResult(NearbyActivity.java:167) at android.app.Activity.dispatchRequestPermissionsResult(Activity.java:6553) at android.app.Activity.dispatchActivityResult(Activity.java:6432) at android.app.ActivityThread.deliverResults(ActivityThread.java:3695) at android.app.ActivityThread.handleSendResult(ActivityThread.java:3742) at android.app.ActivityThread.-wrap16(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1393) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
This is cause the app is trying to load the NoPermissionsFragment in the onRequestPermissionsResult, which I think should be fine but clearly its not cause it crashes every time.
Secondly, launching a Fragment just to show a simple error message seems way too excessive. Personally, I would just show a dialog with the necessary error message along with 2 buttons, 1 with an "OK" text, clicking which would just close the activity and the other with a "Retry" text that would ask the run time permission again.
What do you guys think?
The text was updated successfully, but these errors were encountered: