Crash Reported on Google Play: java.lang.NullPointerException

Bug #1264506 reported by Stefan Hammer on 2013-12-27
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Tomdroid
Fix Released
High
Unassigned

Bug Description

java.lang.RuntimeException: Unable to start activity ComponentInfo{org.tomdroid/org.tomdroid.ui.CompareNotes}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1830)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1851)
at android.app.ActivityThread.access$1500(ActivityThread.java:132)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1038)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:150)
at android.app.ActivityThread.main(ActivityThread.java:4277)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at org.tomdroid.sync.SyncService.addPushable(SyncService.java:592)
at org.tomdroid.ui.CompareNotes.pushNote(CompareNotes.java:492)
at org.tomdroid.ui.CompareNotes.onCreate(CompareNotes.java:206)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1072)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1794)
... 11 more

It seems that this user put the app to the background with CompareNotes showing. When it was brought to the front again, SyncService was already destroyed leading to NullPointer.

Changed in tomdroid:
assignee: nobody → Stefan Hammer (j-4)

I can reporduce this:
*) Trigger a conflict to get the conflict dialog
*) Go to launcher and then wait for long time (or swipe app away in taskswitcher overview)
*) Start tomdroid and sync

12-27 22:39:56.835: E/AndroidRuntime(7362): FATAL EXCEPTION: main
12-27 22:39:56.835: E/AndroidRuntime(7362): Process: org.tomdroid, PID: 7362
12-27 22:39:56.835: E/AndroidRuntime(7362): java.lang.RuntimeException: Unable to start activity ComponentInfo{org.tomdroid/org.tomdroid.ui.CompareNotes}: java.lang.NullPointerException
12-27 22:39:56.835: E/AndroidRuntime(7362): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
12-27 22:39:56.835: E/AndroidRuntime(7362): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
12-27 22:39:56.835: E/AndroidRuntime(7362): at android.app.ActivityThread.access$800(ActivityThread.java:135)
12-27 22:39:56.835: E/AndroidRuntime(7362): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
12-27 22:39:56.835: E/AndroidRuntime(7362): at android.os.Handler.dispatchMessage(Handler.java:102)
12-27 22:39:56.835: E/AndroidRuntime(7362): at android.os.Looper.loop(Looper.java:136)
12-27 22:39:56.835: E/AndroidRuntime(7362): at android.app.ActivityThread.main(ActivityThread.java:5017)
12-27 22:39:56.835: E/AndroidRuntime(7362): at java.lang.reflect.Method.invokeNative(Native Method)
12-27 22:39:56.835: E/AndroidRuntime(7362): at java.lang.reflect.Method.invoke(Method.java:515)
12-27 22:39:56.835: E/AndroidRuntime(7362): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
12-27 22:39:56.835: E/AndroidRuntime(7362): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
12-27 22:39:56.835: E/AndroidRuntime(7362): at dalvik.system.NativeStart.main(Native Method)
12-27 22:39:56.835: E/AndroidRuntime(7362): Caused by: java.lang.NullPointerException
12-27 22:39:56.835: E/AndroidRuntime(7362): at org.tomdroid.sync.SyncService.addPushable(SyncService.java:592)
12-27 22:39:56.835: E/AndroidRuntime(7362): at org.tomdroid.ui.CompareNotes.pushNote(CompareNotes.java:498)
12-27 22:39:56.835: E/AndroidRuntime(7362): at org.tomdroid.ui.CompareNotes.onCreate(CompareNotes.java:205)
12-27 22:39:56.835: E/AndroidRuntime(7362): at android.app.Activity.performCreate(Activity.java:5231)
12-27 22:39:56.835: E/AndroidRuntime(7362): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
12-27 22:39:56.835: E/AndroidRuntime(7362): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
12-27 22:39:56.835: E/AndroidRuntime(7362): ... 11 more

SyncService is now a Service and therefore underlies the Android Lifecycle.
http://developer.android.com/reference/android/app/Service.html

Changed in tomdroid:
status: New → Fix Committed

Another report with add pullable

java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.util.ArrayList.add(java.lang.Object)' on a null object reference
at org.tomdroid.sync.SyncService.addPullable(SyncService.java:588)
at org.tomdroid.ui.CompareNotes.pullNote(CompareNotes.java:484)
at org.tomdroid.ui.CompareNotes.onChooseNote(CompareNotes.java:451)
at org.tomdroid.ui.CompareNotes$4.onClick(CompareNotes.java:328)
at android.view.View.performClick(View.java:4438)
at android.view.View$PerformClick.run(View.java:18422)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)

Changed in tomdroid:
status: Fix Committed → In Progress
Changed in tomdroid:
status: In Progress → Fix Committed
Changed in tomdroid:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers