java.lang.IllegalStateException: RxPermissions.onRequestPermissionsResult invoked but didn't find the corresponding permission request. #46
Comments
Do you answer to the permission dialog on 1. ? |
no, I leave app while dialog is shown |
Ok there's probably a bug but the case you described is kindy weird... Why the user would go to the settings before answering the permission dialog ? |
Yes, it is weird. |
Can you provide a detailled stack trace please? |
java.lang.RuntimeException: Failure delivering result ResultInfo{who=@android:requestPermissions:, request=42, result=-1, data=Intent { act=android.content.pm.action.REQUEST_PERMISSIONS (has extras) }} to activity {.../com.tbruyelle.rxpermissions.ShadowActivity}: java.lang.IllegalStateException: RxPermissions.onRequestPermissionsResult invoked but didn't find the corresponding permission request. |
Ok I think I understand. RxPermissions should probably save the state when the app is killed, and restore it after. If you have some time to develop a fix, I could merge it. I don't have the time for the moment sorry. |
@tbruyelle |
@tbruyelle |
+1 Got the same issue in production. |
@tbruyelle so what do you think about PR? |
I have just started open beta for my app, have some 500 users, maybe half of them active at best. |
@AAverin Note that the bug affects only devices with sdk >= 23 |
@tbruyelle yes, you're right, my bug is on 6.0.1. |
@AAverin Agree I want to resolve it but until now nobody found an acceptable fix. |
I don't think the issue can be resolved. |
@flztsj if you request permissions without rx, even if you try the described steps, your app will not crash. I request permissions with this helper I wrote and it works: https://gist.github.com/gotev/67c300c563bdf68a502c Maybe it can be useful to figure out what is going wrong with RxPermissions |
Fixed in 0.8.0 |
@tbruyelle 0.8.0 is tag on github, but not marked as latest release. Is it safe to grab it and use? |
I found that app will crash while mutil RxPermission request at one time. @tbruyelle caused by the same issue. |
@YellFunGit what version are you using? |
One of my activities asks for camera permission on trigger (button click)
After following steps, exception is thrown:
from what I saw in code:
RxPermissions.request_() where mSubjects is filled is called before permission is revoked by user
After user revoked permission app is recreated in new process and mSubjects is empty - therefore exception is thrown in RxPermissions.onRequestPermissionsResult()
Can you please fix this or suggest a workaround?
The text was updated successfully, but these errors were encountered: