collect
collect copied to clipboard
Collect is crashing except for receive binary files on external widgets on Android 10, Redmi 7
Software and hardware versions
Collect v2022.2 Beta 2, Android 10 device used Redmi 7
Problem description
On my Android 10 device, Collect crashes when trying to generate answers for external image/video/file/audio widgets.
stacktrace:
2022-04-07 15:28:45.588 22683-22683/? E/AndroidRuntime: FATAL EXCEPTION: main Process: org.odk.collect.android, PID: 22683 java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=25, result=-1, data=Intent { act=android.intent.action.SEND_MULTIPLE flg=0x1 clip={text/uri-list NULL ...} (has extras) }} to activity {org.odk.collect.android/org.odk.collect.android.activities.FormEntryActivity}: java.lang.NullPointerException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkNotNullParameter, parameter uri at android.app.ActivityThread.deliverResults(ActivityThread.java:4927) at android.app.ActivityThread.handleSendResult(ActivityThread.java:4968) at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2043) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:221) at android.app.ActivityThread.main(ActivityThread.java:7542) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950) Caused by: java.lang.NullPointerException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkNotNullParameter, parameter uri at org.odk.collect.permissions.PermissionsProvider.requestReadUriPermission(Unknown Source:7) at org.odk.collect.android.activities.FormEntryActivity.loadFile(FormEntryActivity.java:880) at org.odk.collect.android.activities.FormEntryActivity.onActivityResult(FormEntryActivity.java:835) at android.app.Activity.dispatchActivityResult(Activity.java:8249) at android.app.ActivityThread.deliverResults(ActivityThread.java:4920) at android.app.ActivityThread.handleSendResult(ActivityThread.java:4968) at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2043) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:221) at android.app.ActivityThread.main(ActivityThread.java:7542) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
Steps to reproduce the problem
- Open External image widget
- Tap Launch
- Tap on Return Generated Answer - crash occurs
Expected behavior
Collect should not crash, binary file should be received and visible.
Other information
I have used app: CollectAnswerProvider.zip and All widgets form. @srujner is reporting that issue does not occur on his Android 10 and 11 devices. It is also not visible on my Android 8.1 device.
I'm not able to reproduce so I have a few questions:
- Are you sure it's regression? I can't spot anything that we have changed over the course of the current release cycle related to that functionality.
- Does the crash occur for all media files?
- Could you also try this form where media files are loaded together as a group: https://github.com/grzesiek2010/CollectAnswersProvider/blob/master/external_widgets.xlsx
- Could you try building
CollectAnswersProvider
from my github: https://github.com/grzesiek2010/CollectAnswersProvider. I'm not sure if your apk is the updated version of it.
This has shown up in Firebase: https://console.firebase.google.com/u/1/project/api-project-322300403941/crashlytics/app/android:org.odk.collect.android/issues/324e6f8b0ffe4693e324c7a2d5f2f872?time=last-seven-days&versions=v2022.2-beta.2%20(4405)&types=crash&sessionEventKey=62500A4501F40001309EDB65926659C8_1662630368995684235
I verified it on Xiaomi Redmi 7a with Android 10 (real device) and I wasn’t able to reproduce on Collect v2022.2 Beta 2 . I also checked it with don’t keep activities and no background processes settings enabled. We also verified on Redmi 9T with Android 10, Pixel 3a Android 11, Pixel 6a Android 13 and we didn’t notice any crashes.
https://console.firebase.google.com/u/1/project/api-project-322300403941/crashlytics/app/android:org.odk.collect.android/issues/324e6f8b0ffe4693e324c7a2d5f2f872?time=last-ninety-days&types=crash&sessionEventKey=63AEE573026800014CAB33EC61F16D1B_1761389846297707350 I'm seeing 10 instances in the last 90 days on v2022.3.6, 9 on v2022.3.5. It doesn't look related to manufacturer or Android version (8.1, 10, 11, 12).
I don't think we should worry about this, especially given we know it works on @dbemke's device.