Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NullPointerException due to 'void dalvik.system.CloseGuard.close()' in lollipop [duplicate]

I get the following exception in the background while my app runs in Android OS Lollipop. Not able to figure out its exact place or any reference to it in my code.

02-23 17:58:14.145: E/System(16417): Uncaught exception thrown by finalizer
02-23 17:58:14.146: E/System(16417): java.lang.NullPointerException: Attempt to invoke virtual method 'void dalvik.system.CloseGuard.close()' on a null object reference
02-23 17:58:14.146: E/System(16417):    at java.io.FileInputStream.close(FileInputStream.java:113)
02-23 17:58:14.146: E/System(16417):    at java.io.FileInputStream.finalize(FileInputStream.java:140)
02-23 17:58:14.146: E/System(16417):    at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:190)
02-23 17:58:14.146: E/System(16417):    at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:173)
02-23 17:58:14.146: E/System(16417):    at java.lang.Thread.run(Thread.java:818)

Any specific reason that why the Android OS library crashes?

like image 478
Harpreet Avatar asked Feb 23 '15 12:02

Harpreet


1 Answers

I encountered a similar problem.
I used fragments in my code which called an AsyncTask. When I called the recreate() method of my activity, fragments were getting executed twice.
And that was the reason of my problem. I have solved my problem with this solution : Fragment onCreateView and onActivityCreated called twice.

like image 188
ID Virtuelle Avatar answered Nov 16 '22 07:11

ID Virtuelle