Error in ODK Collect: Attempt to invoke virtual method 'java.lang.String.org.javarosa.core.model.SelectChoice.getTextID()' on a null object reference

1. What is the problem? Be very detailed.
I am receiving an error that does not allow me to view information on the repeat groups when trying to edit saved form and view sent form.

2. What app or server are you using and on what device and operating system? Include version numbers.
ODK Collect v2021.2.4

3. What you have you tried to fix the problem?
But when I use ODK Collect v1.30.1 - repeat group it works fine and no above problem.

4. What steps can we take to reproduce the problem?
You can try ODK Collect v2021.2.4 and save a form that has a repeat group then try to edit or view the values in any of the repeat groups.

5. Anything else we should know or have? If you have a test form or screenshots or logs, attach below.
Screenshot_ODK Collect

Hi @Chonticha

Could you attach your form?

Hi @Grzesiek2010, my form is attached.

Discharge_form.xlsx (15.7 KB)

Hmmm there is something wrong indeed but the exception takes place randomly (there is no one single scenario to reproduce it). I'll try to track it down. Thanks for the form!

It happens for example if I open a saved form with at least two repeatable groups and click on the first one and the navigate up in the hierarchy and click the second one. So navigating in hierarchy view is broken but you should be able to open the first repeatable group and then navigate to the other groups just swiping forward/backward. Could you confirm that this works for you?

1 Like

Thank you very much for this.
Yes, it works when I open the form from "Edit Saved Form", but this doesn't work for viewing in "View Sent Forms".

but this doesn't work for viewing in "View Sent Forms"

eve if you open just one group? From what I noticed the issue occurs if you try to open one group and then another one.

Thanks a lot for reporting the issue and providing a sample form. We have seen this exception in our reports but we didn't know how to reproduce it. Now we should be able to fix the issue soon.

Hello,
I encounter the same bug on version 2021.2.4,
I just follow your remark, indeed on the old version ODK Collect v1.30.1 my code works perfectly.
Like i don't use a xls process to build the xml form, I thought it came from my bad syntax on multi choice filter on a select . I had been battling this warning since this morning.

I get this error when i add a choice filter in a group repeat in a form, as you say, the error happens when re-editing the form.
I try to put very simple expression filter with a constant and the error was still here.


<select1 ref="/data/repeat_parcelle/repeat_observation/DeroulerFicheObservation">
	<label>Nouvelle observation / prélèvement</label>
		<itemset nodeset="instance('ChoixObs')/root/item[(filter = '1')]">
		   <value ref="value"/>
		   <label ref="label"/>
		</itemset>
</select1>

Here a really ugly and basic form to reproduce the error.
I truncated my form to debug.

AAA2022_breve.xml (32.5 KB)

The source that i am coding, it's a draft but more structured.

AAA2022.xml (392.8 KB)

If it can help..

Thanks for helping us troubleshoot this issue. Please confirm that your forms now work with the v2021.3 beta.

Hello,
I test on the version v2021.3 beta,
but i still have the error,

but it's working on ODK COllect v1.27.3 and v1.30.1 (i test 2 devices with 2 old version)

Instance filled
04testForm_2021-10-28_17-05-36.xml (768 Bytes)

Blank form
04testForm.xml (2.8 KB)

The problem appears only on a select choice in the repeat, if the select is checked. If i let it empty, it's working.

Merci, @Olivier_Poujade. We fixed it when you visit the field in the form entry view first but not if you go straight to the table of contents view. I appreciate the follow-up and the really clear description of what you did complete with a sample. :pray:

We had a complete fix but hadn't correctly updated it in the beta. @Olivier_Poujade I've tried your scenario with ODK Collect v2021.3 and I believe everything now works as expected.