Open jo-spek opened 1 week ago
Pulled the stacktrace from crashlytics:
Fatal Exception: java.util.NoSuchElementException: Collection contains no element matching the predicate.
at com.google.android.ground.ui.datacollection.DataCollectionViewModel.getTaskSequence(DataCollectionViewModel.kt:403)
at com.google.android.ground.ui.datacollection.DataCollectionViewModel.getTaskSequence$default(DataCollectionViewModel.kt:314)
at com.google.android.ground.ui.datacollection.DataCollectionViewModel.getPositionInTaskSequence(DataCollectionViewModel.kt:300)
at com.google.android.ground.ui.datacollection.DataCollectionViewModel.getTaskPosition(DataCollectionViewModel.kt:343)
at com.google.android.ground.ui.datacollection.DataCollectionViewModel.<init>(DataCollectionViewModel.kt:151)
at com.google.android.ground.DaggerGroundApplication_HiltComponents_SingletonC$ViewModelCImpl$SwitchingProvider.get(DaggerGroundApplication_HiltComponents_SingletonC.java:1478)
at dagger.hilt.android.internal.lifecycle.HiltViewModelFactory$2.createViewModel(HiltViewModelFactory.java:132)
at dagger.hilt.android.internal.lifecycle.HiltViewModelFactory$2.create(HiltViewModelFactory.java:103)
at dagger.hilt.android.internal.lifecycle.HiltViewModelFactory.create(HiltViewModelFactory.java:170)
at androidx.lifecycle.ViewModelProvider.get(ViewModelProvider.kt:184)
at androidx.lifecycle.ViewModelProvider.get(ViewModelProvider.kt:150)
at androidx.lifecycle.ViewModelLazy.getValue(ViewModelLazy.kt:53)
at androidx.lifecycle.ViewModelLazy.getValue(ViewModelLazy.kt:35)
at com.google.android.ground.ui.datacollection.DataCollectionFragment.getViewModel(DataCollectionFragment.kt:49)
at com.google.android.ground.ui.datacollection.DataCollectionFragment.onViewCreated(DataCollectionFragment.kt:78)
at androidx.fragment.app.Fragment.performViewCreated(Fragment.java:3147)
at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:588)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:272)
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1943)
at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1845)
at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1782)
at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:565)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:210)
at android.os.Looper.loop(Looper.java:299)
at android.app.ActivityThread.main(ActivityThread.java:8319)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1038)
@shobhitagarwal1612 @sufyanAbbasi Do you have bandwidth to take this one on in the next week or so?
I can take a first pass
Thank you, @shobhitagarwal1612
val startIndex = tasks.indexOf(tasks.first { it.id == (startId ?: tasks[0].id) })
The error is happening at line tasks.first { ... }
It is not able to find a task from the list with matching task id.
@jo-spek Are you able to reproduce this consistently? I tried reproing it but wasn't successful.
From crashlytics, I can see that it has happened 14 times in total for 3 different users.
@jo-spek Can you please share the URL of the survey in question in private (by email)?
Describe the bug
After having recorded a new site in my survey that does not require anything else but recording a geometry (no further questions, no photo demanded), there is a white pane at the bottom of my screen with the record's name and a green button "Collect data". If I click that button, the app crashes. This does not happen in another survey, where I can answer additional survey questions about a recorded item that I have previously skipped when I click "Collect data". Happened on Xiaomi Poco X3 with Andoird 12 SQK1.211019.001.
To Reproduce Steps to reproduce the behavior:
Expected behavior I don't really know. Probably not crash. Rather have the "Collect data"-button greyed out.
Actual behavior Button is there and clickable and triggers a crash of the application.
Screenshots![Collect_data_bug](https://github.com/google/ground-android/assets/93268515/9ab05958-2028-4fd2-a4a9-855fe45bc824)