Hello,
I have developed a custom implementation of the Open Rosa protocol so that ODK Collect can "talk" directly with our (Java) system. It went very smoothly and it is working fine, thanks to the excellent documentation!
However, I cannot get external instances to work. I have implemented the whole chain (manifest referenced in the form list, and then download URL in the manifest itself), but ODK Collect refuses to update the form, without an error message. Android sometimes says that it has crashed, and I have sent an error report / feedback this morning via Android, so maybe you have received it.
I can see on the server that the web services are properly called, in the order one would expect:
217.9.50.47 - - [13/Oct/2021:10:05:42 +0000] "GET /api/odk/formList HTTP/1.1" 401 - "-" "org.odk.collect.android/v2021.2.4 Dalvik/2.1.0 (Linux; U; Android 9; SM-G390F Build/PPR1.180610.011)"
217.9.50.47 - - [13/Oct/2021:10:05:42 +0000] "GET /api/odk/formList HTTP/1.1" 200 767 "-" "org.odk.collect.android/v2021.2.4 Dalvik/2.1.0 (Linux; U; Android 9; SM-G390F Build/PPR1.180610.011)"
217.9.50.47 - - [13/Oct/2021:10:05:42 +0000] "GET /api/odk/formManifest/example/form/SimpleExampleForm/manifest HTTP/1.1" 200 359 "-" "org.odk.collect.android/v2021.2.4 Dalvik/2.1.0 (Linux; U; Android 9; SM-G390F Build/PPR1.180610.011)"
217.9.50.47 - - [13/Oct/2021:10:05:47 +0000] "GET /api/odk/form/example/form/SimpleExampleForm HTTP/1.1" 200 13253 "-" "org.odk.collect.android/v2021.2.4 Dalvik/2.1.0 (Linux; U; Android 9; SM-G390F Build/PPR1.180610.011)"
217.9.50.47 - - [13/Oct/2021:10:05:47 +0000] "GET /api/odk/formManifest/example/form/SimpleExampleForm/manifest/tag HTTP/1.1" 200 110 "-" "org.odk.collect.android/v2021.2.4 Dalvik/2.1.0 (Linux; U; Android 9; SM-G390F Build/PPR1.180610.011)"
In the form the secondary instance looks like:
...
<instance id="tag" src="jr://file/example/terms/tag.xml"/>
...
The manifest is:
<?xml version='1.0' encoding='UTF-8' ?>
<manifest xmlns="http://openrosa.org/xforms/xformsManifest">
<mediaFile>
<filename>example/terms/tag.xml</filename>
<hash>md5sum:b984d68cd0bee21384ca51cef7c90880</hash>
<downloadUrl>https://examples-unstable.work.argeo.pro/api/odk/formManifest/example/form/SimpleExampleForm/manifest/tag</downloadUrl>
</mediaFile>
</manifest>
And the download URL returns:
<?xml version="1.0" encoding="UTF-8"?><tag><term name="important"/><term name="long"/><term name="new"/></tag>
I have tried to pull the form using ODK BriefCase, and it seems happy with it:
2021-10-13 11:03:05,522 [ForkJoinPool-4-worker-3] INFO o.o.b.p.a.PullFromAggregateTracker - Pull SimpleExampleForm - Start pulling form and submissions
2021-10-13 11:03:05,536 [ForkJoinPool-4-worker-3] INFO o.o.b.p.a.PullFromAggregateTracker - Pull SimpleExampleForm - Start downloading form
2021-10-13 11:03:05,692 [ForkJoinPool-4-worker-3] INFO o.o.b.p.a.PullFromAggregateTracker - Pull SimpleExampleForm - Form downloaded
2021-10-13 11:03:05,699 [ForkJoinPool-4-worker-3] INFO o.o.b.p.a.PullFromAggregateTracker - Pull SimpleExampleForm - Start getting form manifest
2021-10-13 11:03:05,737 [ForkJoinPool-4-worker-3] INFO o.o.b.p.a.PullFromAggregateTracker - Pull SimpleExampleForm - Got the form manifest
2021-10-13 11:03:05,741 [ForkJoinPool-4-worker-3] INFO o.o.b.p.a.PullFromAggregateTracker - Pull SimpleExampleForm - Start downloading form attachment 1 of 1
2021-10-13 11:03:05,769 [ForkJoinPool-4-worker-3] INFO o.o.b.p.a.PullFromAggregateTracker - Pull SimpleExampleForm - Form attachment 1 of 1 downloaded
...
2021-10-13 11:03:06,346 [AWT-EventQueue-0] INFO XFormParser - Reading XML and parsing with kXML2 finished in 3.021 ms
2021-10-13 11:03:06,349 [AWT-EventQueue-0] INFO XFormParser - Consolidating text finished in 1.830 ms
2021-10-13 11:03:06,350 [AWT-EventQueue-0] INFO XFormParser - Parsing form...
2021-10-13 11:03:06,350 [AWT-EventQueue-0] INFO XFormParser - Title: "Example Session"
...
2021-10-13 11:03:06,406 [AWT-EventQueue-0] INFO XFormParser - Creating FormDef from parsed XML finished in 56.322 ms
So, the problem only appears on ODK Collect. I must be doing something wrong, but I cannot find logs on the mobile phone.
How do you think I should proceed from here?
Thanks in advance!
Mathieu
PS: This testing environment is only with dummy data, so I can easily provide an access if someone wants to reproduce directly.