Fatal Exception: java.lang.IllegalArgumentException: no dialog with id 2 was ever shown via Activity#showDialog

1. What is the problem? Be very detailed.

  • We have integrated ODK forms in the Android app, also customized ODK some of the classes as per our need.
    We have been working with ODK forms for 7 and more years, and from Feb 2022 we are facing an issue with the app is crashing when we try to mark complete the form, where app saves forms data update database, app crashes for "Fatal Exception: java.lang.IllegalArgumentException: no dialog with id 2 was ever shown via Activity#showDialog"

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

  • Android app
    -Samsung Galaxy M11(Some devices with diffrent make but mostly Samsung)
    -Android OS 9, 10, 11

3. What have you tried to fix the problem?
-As per below link we have added try catch block on dismiss dialog

4. What steps can we take to reproduce the problem?
-Fill multiple forms and save it and mark complete, as per github link issue is not reproducible

5. Anything else we should know or have? If you have a test form or screenshots or logs, attached below.
java.lang.IllegalArgumentException: no dialog with id 2 was ever shown via Activity#showDialog
at android.app.Activity.missingDialog(Activity.java:4932)
at android.app.Activity.dismissDialog(Activity.java:4917)
at .FormEntryActivity.savingComplete(FormEntryActivity.java:894)
at org.odk.collect.android.tasks.SaveToDiskTask.onPostExecute(SaveToDiskTask.java:564)
at org.odk.collect.android.tasks.SaveToDiskTask.onPostExecute(SaveToDiskTask.java:73)
at android.os.AsyncTask.finish(AsyncTask.java:771)
at android.os.AsyncTask.access$900(AsyncTask.java:199)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:788)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:236)
at android.app.ActivityThread.main(ActivityThread.java:7861)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:600)
at com.android.internal.os.ZygoteIn

Can you replicate this problem on stock ODK Collect? If not, we are limited in the help we can provide for your fork.