Repository: tbruyelle/RxPermissions

Issue #46: java.lang.IllegalStateException: RxPermissions.onRequestPermissionsResult invoked but didn't find the corresponding permission request.
Created: 2016-05-10T15:05:48Z
One of my activities asks for camera permission on trigger (button click)
After following steps, exception is thrown:

user presses button and shadow activity with dialog that asks for permission is shown
user goes to settings and revoke some other permission
user reopens app - shadow activity with dialog is still there
user allows/denies permission and app crashes with exception

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?

Duplicate issue #74: java.lang.IllegalStateException: RxPermissions.onRequestPermissionsResult invoked but didn't find the corresponding permission request.
Created: 2016-09-02T07:05:03Z
08-31 14:08:34.464414 11720 11720 E AndroidRuntime: FATAL EXCEPTION: main
08-31 14:08:34.464414 11720 11720 E AndroidRuntime: Process: xxx.xxxxxxxx.xxxxxxx.xxxxx, PID: 11720
08-31 14:08:34.464414 11720 11720 E AndroidRuntime: 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 {xxx.xxxxxxxx.xxxxxxx.xxxxx/com.tbruyelle.rxpermissions.ShadowActivity}: java.lang.IllegalStateException: RxPermissions.onRequestPermissionsResult invoked but didn't find the corresponding permission request.
08-31 14:08:34.464414 11720 11720 E AndroidRuntime:     at android.app.ActivityThread.deliverResults(ActivityThread.java:3929)
08-31 14:08:34.464414 11720 11720 E AndroidRuntime:     at android.app.ActivityThread.handleSendResult(ActivityThread.java:3972)
08-31 14:08:34.464414 11720 11720 E AndroidRuntime:     at android.app.ActivityThread.-wrap16(ActivityThread.java)
08-31 14:08:34.464414 11720 11720 E AndroidRuntime:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1537)
08-31 14:08:34.464414 11720 11720 E AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:111)
08-31 14:08:34.464414 11720 11720 E AndroidRuntime:     at android.os.Looper.loop(Looper.java:207)
08-31 14:08:34.464414 11720 11720 E AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5728)
08-31 14:08:34.464414 11720 11720 E AndroidRuntime:     at java.lang.reflect.Method.invoke(Native Method)
08-31 14:08:34.464414 11720 11720 E AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
08-31 14:08:34.464414 11720 11720 E AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)
08-31 14:08:34.464414 11720 11720 E AndroidRuntime: Caused by: java.lang.IllegalStateException: RxPermissions.onRequestPermissionsResult invoked but didn't find the corresponding permission request.
08-31 14:08:34.464414 11720 11720 E AndroidRuntime:     at com.tbruyelle.rxpermissions.b.a(Unknown Source)
08-31 14:08:34.464414 11720 11720 E AndroidRuntime:     at com.tbruyelle.rxpermissions.ShadowActivity.onRequestPermissionsResult(Unknown Source)
08-31 14:08:34.464414 11720 11720 E AndroidRuntime:     at android.app.Activity.dispatchRequestPermissionsResult(Activity.java:6625)
08-31 14:08:34.464414 11720 11720 E AndroidRuntime:     at android.app.Activity.dispatchActivityResult(Activity.java:6504)
08-31 14:08:34.464414 11720 11720 E AndroidRuntime:     at android.app.ActivityThread.deliverResults(ActivityThread.java:3925)
08-31 14:08:34.464414 11720 11720 E AndroidRuntime:     ... 9 more

Closing comment (2016-09-03T08:10:03Z): duplicate of #46