- java.lang.RuntimeException: Failure delivering result ResultInfo #89
- Comments
- Gregliest commented Oct 22, 2016
- tbruyelle commented Oct 22, 2016
- Gregliest commented Oct 22, 2016
- tbruyelle commented Oct 24, 2016
- tarasantoshchuk commented Oct 24, 2016
- Gregliest commented Oct 24, 2016
- tbruyelle commented Oct 24, 2016
- epool commented Nov 24, 2016
- Failure delivering result ResultInfo #243
- Comments
- TeoChopi commented Oct 28, 2019
- Actual behaviour
- Version of the library
- pedrovgs commented Nov 8, 2019
- GuilhE commented Nov 19, 2019 •
- pedrovgs commented Nov 29, 2019 •
- pedrovgs commented Dec 4, 2019
- GuilhE commented Dec 4, 2019 •
java.lang.RuntimeException: Failure delivering result ResultInfo #89
Comments
Gregliest commented Oct 22, 2016
It says in the readme that «the request must be done during an initialization phase.» Otherwise, «the user’s answer will never be emitted to the subscriber.» For my application, it doesn’t matter if some of the responses are dropped, so I’m experimenting with dispatching the permissions request from a non reactive event. However, I’m getting the exception thrown here
Here’s the stack trace:
Is there a workaround? Much appreciated!
The text was updated successfully, but these errors were encountered:
tbruyelle commented Oct 22, 2016
You can also have this kind of exception if you don’t follow the library guidelines.
Gregliest commented Oct 22, 2016
Thanks for the quick response. Yes, I’m going off the rails a little bit here. As I said, I don’t care if some of the responses get dropped if the activity gets recreated. Also, I’m triggering the permissions request from an event, and I can’t easily make the element reactive. I ran into this exception as I was experimenting with how RxPermissions would handle the permissions request in this case.
I read through #3, and I think that the tradeoff of flexibility (requiring the permissions request in the initialization) for completeness is perfectly reasonable, for cases where you need to guarantee that the result is emitted to the subscriber. However, it would also seem reasonable for the library to support cases where it doesn’t matter if the occasional request gets dropped. At least, I didn’t expect the library to crash. I also have no way to catch the exception and act on it, since it’s thrown completely internally to the library. Is there a way to emit the error to the observable?
tbruyelle commented Oct 24, 2016
We can’t emit an error precisely because we can’t find the subject for the requested permission.
tarasantoshchuk commented Oct 24, 2016
@Gregliest
can you post some code, where you’re requesting permissions?
we might be able to provide workaround for you
Gregliest commented Oct 24, 2016
I’m requesting permissions inside of an OnClickListener inside of a Dialog. The code itself is pretty generic, let me know if you actually want to see it. I’m testing by setting the developer option «Don’t keep activities», triggering the system permissions dialog, exiting the app, re-entering the app, and then clicking «allow».
I did a little more digging, since the system permissions dialog is popping up twice. The first dialog is attached to the old observable from the destroyed activity, and the second dialog must be spawned when the ShadowActivity gets recreated. The app crashes when I click allow on the second dialog.
tbruyelle commented Oct 24, 2016
Your code seems to gather all conditions to trigger the biggest flaw of this library : configuration change handling. As you read in #3 there’s no workaround, so we have the choice to follow the guidelines or to stop using RxPermissions .
epool commented Nov 24, 2016
@Gregliest you could try 0.9.0 to verify if that version fixes you problem.
You can’t perform that action at this time.
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.
Источник
Failure delivering result ResultInfo #243
Comments
TeoChopi commented Oct 28, 2019
Actual behaviour
Version of the library
The text was updated successfully, but these errors were encountered:
pedrovgs commented Nov 8, 2019
Hi @TeoChopi could you please provide more information about this error? When is the exception triggered? What permission are you requested? Are you still facing this issue with the library version 6.0.0.? What are the steps to reproduce it? Do you have an example repository reproducing the error?
GuilhE commented Nov 19, 2019 •
I think I may have the same issue in v5.0.0. Personally I never caught it, Fabric’s log:
Fatal Exception: java.lang.RuntimeException
Failure delivering result ResultInfo> to activity <. /com.karumi.dexter.DexterActivity>: java.lang.NullPointerException: Attempt to invoke virtual method ‘void android.app.Activity.finish()’ on a null object reference
Caused by java.lang.NullPointerException
Attempt to invoke virtual method ‘void android.app.Activity.finish()’ on a null object reference
Device
Brand: samsung
Model: Galaxy A20e
Orientation: Portrait
RAM free: 723.34 MB
Disk free: 1.55 GB
Operating System
Version: 9
Orientation: Portrait
Rooted: No
About the permission itself, I’m not 100% sure, but I think it was for location.
I think it could be related with #221
pedrovgs commented Nov 29, 2019 •
I’m going to send a PR with a tentative fix and once it’s merged and release we will close the issue. We are not able to reproduce this error and our uses either so this will be a tentative fix. Please after releasing our new version update your app and let us know if you can still reproduce the error. Please, if the PR I’ve sent doesn’t fix the error, please reopen this issue.
pedrovgs commented Dec 4, 2019
I can confirm Dexter 6.0.1 fixed this issue. If someone else would check it out, that’d be awesome.
GuilhE commented Dec 4, 2019 •
Personally I could never reproduce this issue, I’ve only seen it on Fabric. I’ll have to issue an update and wait for a period of time to see if it will get caught.
But as you stated — and as your code shows — this is fixed 🙂
Источник