Skip to content
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

NullPointerException in LeakCanaryInternals.isInServiceProcess() #449

Closed
elcelista opened this issue Mar 11, 2016 · 1 comment
Closed

NullPointerException in LeakCanaryInternals.isInServiceProcess() #449

elcelista opened this issue Mar 11, 2016 · 1 comment
Milestone

Comments

@elcelista
Copy link

It looks like ActivityManager.getRunningAppProcesses can return null: http://developer.android.com/reference/android/app/ActivityManager.html#getRunningAppProcesses()

LeakCanaryInternals.isInServiceProcess() doesn't seem to check for this case.

Stack trace excerpt:

java.lang.RuntimeException: Unable to create application [...]: java.lang.NullPointerException: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4710)
at android.app.ActivityThread.-wrap1(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
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.NullPointerException: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference
at com.squareup.leakcanary.internal.LeakCanaryInternals.isInServiceProcess(LeakCanaryInternals.java:117)
at com.squareup.leakcanary.LeakCanary.isInAnalyzerProcess(LeakCanary.java:237)
at com.squareup.leakcanary.LeakCanary.install(LeakCanary.java:77)
at com.squareup.leakcanary.LeakCanary.install(LeakCanary.java:42)
[...]

pyricau added a commit that referenced this issue Mar 20, 2016
Fixes #449
@pyricau pyricau mentioned this issue Mar 20, 2016
@pyricau pyricau added this to the 1.4 milestone Mar 20, 2016
@pyricau
Copy link
Member

pyricau commented Mar 20, 2016

Thanks!

Pengchengxiang pushed a commit to XLibrarys/leakcanary that referenced this issue Jan 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants