Collect: NPE in FormEntryActivity.java line 2677

Created on 25 Sep 2020  路  9Comments  路  Source: getodk/collect

Software and hardware versions

Collect v1.28.0

Problem description

https://console.firebase.google.com/u/0/project/api-project-322300403941/crashlytics/app/android:org.odk.collect.android/issues/d6df6553f58a3d3f828bdfe036cd855d?time=last-seven-days&versions=v1.28.0%20(3921)&sessionEventKey=5F6C5B9200330001597993BC55946D5D_1454417872317206815

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'org.javarosa.form.api.FormEntryPrompt org.odk.collect.android.widgets.QuestionWidget.getFormEntryPrompt()' on a null object reference
       at org.odk.collect.android.activities.FormEntryActivity$10.run(FormEntryActivity.java:2677)
       at android.app.Activity.runOnUiThread(Activity.java:5643)
       at org.odk.collect.android.activities.FormEntryActivity.widgetValueChanged(FormEntryActivity.java:2674)
       at org.odk.collect.android.activities.FormEntryActivity.updateSelectedItems(FormEntryActivity.java:2573)
       at org.odk.collect.android.fragments.dialogs.SelectMinimalDialog.closeDialogAndSaveAnswers(SelectMinimalDialog.java:100)
       at org.odk.collect.android.fragments.dialogs.SelectOneMinimalDialog.onItemClicked(SelectOneMinimalDialog.java:38)
       at org.odk.collect.android.formentry.questions.AudioVideoImageTextLabel.lambda$setTextView$0(AudioVideoImageTextLabel.java:118)
       at org.odk.collect.android.formentry.questions.-$$Lambda$AudioVideoImageTextLabel$MqCYJ2yJoQ6DnhH04sxqp-kc3wc.onClick(-.java)
       at android.view.View.performClick(View.java:5265)
       at android.widget.CompoundButton.performClick(CompoundButton.java:122)
       at android.view.View$PerformClick.run(View.java:21534)
       at android.os.Handler.handleCallback(Handler.java:815)
       at android.os.Handler.dispatchMessage(Handler.java:104)
       at android.os.Looper.loop(Looper.java:207)
       at android.app.ActivityThread.main(ActivityThread.java:5737)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)
in progress

All 9 comments

I wonder whether this crash might be related:

Fatal Exception: java.lang.NullPointerException
Attempt to invoke virtual method 'org.javarosa.form.api.FormEntryPrompt org.odk.collect.android.widgets.QuestionWidget.getFormEntryPrompt()' on a null object reference
org.odk.collect.android.activities.FormEntryActivity$10.run (FormEntryActivity.java:2681)
android.app.Activity.runOnUiThread (Activity.java:6974)
org.odk.collect.android.activities.FormEntryActivity.widgetValueChanged (FormEntryActivity.java:2678)
org.odk.collect.android.activities.FormEntryActivity.updateSelectedItems (FormEntryActivity.java:2577)
org.odk.collect.android.fragments.dialogs.SelectMinimalDialog.closeDialogAndSaveAnswers (SelectMinimalDialog.java:100)
org.odk.collect.android.fragments.dialogs.SelectOneMinimalDialog.onItemClicked (SelectOneMinimalDialog.java:38)
org.odk.collect.android.formentry.questions.AudioVideoImageTextLabel.lambda$setTextView$0 (AudioVideoImageTextLabel.java:118)
org.odk.collect.android.formentry.questions.-$$Lambda$AudioVideoImageTextLabel$MqCYJ2yJoQ6DnhH04sxqp-kc3wc.onClick (-.java:2)

It also seems to only happen in the context of minimal selects.

This is exactly the same crash, stacktrace is not identical but it's the same.

I tried to reproduce this crash. I created a few forms with different specifications. I focused on Select one with a minimal appearance.
I set it as a required, read-only, in field-list, in repeat group, added default value, added incorrect default value, and a lot of different configurations.
I loaded new form, saved form, and from savepoint.
I was not able to cause a crash and define repro steps.

Hah this is not related only to SelectMinimal I knew that it couldn't be, in the same group of crashes we have this:
https://console.firebase.google.com/u/0/project/api-project-322300403941/crashlytics/app/android:org.odk.collect.android/issues/b70744064d70319471267a25d4281b48?time=last-seven-days&versions=v1.28.1%20(3923)&sessionEventKey=5F7C278602B300016B67A6546675775D_1458890331817504999

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'org.javarosa.form.api.FormEntryPrompt org.odk.collect.android.widgets.QuestionWidget.getFormEntryPrompt()' on a null object reference
       at org.odk.collect.android.activities.FormEntryActivity$10.run(FormEntryActivity.java:2681)
       at android.app.Activity.runOnUiThread(Activity.java:6972)
       at org.odk.collect.android.activities.FormEntryActivity.widgetValueChanged(FormEntryActivity.java:2678)
       at org.odk.collect.android.activities.FormEntryActivity.onRankingChanged(FormEntryActivity.java:2563)

we use the same approach (to pass answers) in SelectMinimal, RankingWidget and DateWidget so it's something broader looks as if SelectMinimal is way more popular that's why we had reports only from that feature.

4123 adds a log item for a null formcontroller. We don't seem to be getting that one. We always see Attempting to return data to a widget or set of widgets not looking for data before the crash.

I tried yesterday one more time but wasn't able to reproduce the issue neither come up with new ideas so it's time to give up. However I was able to reproduce another issue that might be related: https://github.com/getodk/collect/issues/4170

Hello @grzesiek2010, you have been unassigned from this issue because you have not updated this issue or any referenced pull requests for over 15 days.

You can reclaim this issue or claim any other issue by commenting @getodk-bot claim on that issue.

Thanks for your contributions, and hope to see you again soon!

I thought it could be related to #4187 but wasn't able to reproduce anything. https://docs.google.com/spreadsheets/d/1RbbQMuaZ1bXC36eYPW6qHtHvHS8tnnEQL7fYFG-XRQM/edit#gid=0 has some of my attempts.

It could also be related to #4182. At this point, I think we do the point release and see whether it's still happening or not.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

seadowg picture seadowg  路  3Comments

kkrawczyk123 picture kkrawczyk123  路  3Comments

grzesiek2010 picture grzesiek2010  路  5Comments

rcovane picture rcovane  路  3Comments

nribeka picture nribeka  路  4Comments