Skip to content
This repository has been archived by the owner on Feb 11, 2022. It is now read-only.

java.lang.RuntimeException: Unable to pause activity #157

Closed
DasserBasyouni opened this issue Feb 1, 2018 · 4 comments
Closed

java.lang.RuntimeException: Unable to pause activity #157

DasserBasyouni opened this issue Feb 1, 2018 · 4 comments

Comments

@DasserBasyouni
Copy link

Problem

I am following the guide of the README.md

when I traced the problem I found it occurs in .withConnectableCallbacks() .clear() in clearRegistrations() in Registrar class is run

java.lang.RuntimeException: Unable to pause activity......... Caused by: java.lang.NullPointerException at com.novoda.merlin.registerable.Registrar.clearRegistrations(Registrar.java:65) at com.novoda.merlin.Merlin.unbind(Merlin.java:30) at com.example.android.onegreatpost.MainActivity.onPause(MainActivity.java:155) at android.app.Activity.performPause(Activity.java:5426) at android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1244) at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3304) at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3273)  at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:3251)  at android.app.ActivityThread.access$1300(ActivityThread.java:143)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1279)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:136)  at android.app.ActivityThread.main(ActivityThread.java:5356)  at java.lang.reflect.Method.invokeNative(Native Method)  at java.lang.reflect.Method.invoke(Method.java:515)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:680)  at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:133)  at dalvik.system.NativeStart.main(Native Method) 

Potential Solution

I might be make use .withBindableCallbacks() & .withDisconnectableCallbacks() for now
or fix it from the clearRegistrations() and check null values becfore clearing

Thanks in advance

@Mecharyry
Copy link
Contributor

Hi @DasserBasyouni sorry for the late reply, I've been on holiday. I'll try and reproduce this issue on my end and get a fix out. I'll keep you updated, should be solved by the end of the week.

@Mecharyry
Copy link
Contributor

@DasserBasyouni I've patched the issue, just waiting on reviews and then will try to ship ASAP #158

@Mecharyry
Copy link
Contributor

Hi @DasserBasyouni https://github.com/novoda/merlin/releases/tag/v.1.1.6 fixes this issue.

@DasserBasyouni
Copy link
Author

DasserBasyouni commented Feb 25, 2018

thank you so much for your reply and for fixing the problem, I will test it again sooner or later in another project and I will surely report any error if exist to you, and sorry for my lateness I was not having access to my whole laptop those 2 weeks cuz of the fail of the hard disk.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants