Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getTaskViewModel - Collection contains no element matching the predicate. #2998

Open
anandwana001 opened this issue Jan 13, 2025 · 2 comments
Assignees
Labels
type: bug Something isn't working

Comments

@anandwana001
Copy link
Collaborator

Caused by java.util.NoSuchElementException: Collection contains no element matching the predicate.
       at com.google.android.ground.ui.datacollection.DataCollectionViewModel.getTaskViewModel(DataCollectionViewModel.kt:467)
       at com.google.android.ground.ui.datacollection.DataCollectionViewModel.saveCurrentState(DataCollectionViewModel.kt:252)
       at com.google.android.ground.ui.datacollection.DataCollectionFragment.onPause(DataCollectionFragment.kt:117)
       at androidx.fragment.app.Fragment.performPause(Fragment.java:3330)
       at androidx.fragment.app.FragmentStateManager.pause(FragmentStateManager.java:692)
       at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:318)
       at androidx.fragment.app.FragmentStore.moveToExpectedState(FragmentStore.java:114)
       at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1675)
       at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3259)
       at androidx.fragment.app.FragmentManager.dispatchPause(FragmentManager.java:3195)
       at androidx.fragment.app.Fragment.performPause(Fragment.java:3323)
       at androidx.fragment.app.FragmentStateManager.pause(FragmentStateManager.java:692)
       at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:318)
       at androidx.fragment.app.FragmentStore.moveToExpectedState(FragmentStore.java:114)
       at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1675)
       at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3259)
       at androidx.fragment.app.FragmentManager.dispatchPause(FragmentManager.java:3195)
       at androidx.fragment.app.FragmentController.dispatchPause(FragmentController.java:296)
       at androidx.fragment.app.FragmentActivity.onPause(FragmentActivity.java:284)
       at com.google.android.ground.AbstractActivity.onPause(AbstractActivity.kt:63)
       at android.app.Activity.performPause(Activity.java:8870)
       at android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1618)
       at android.app.ActivityThread.performPauseActivityIfNeeded(ActivityThread.java:5722)
       at android.app.ActivityThread.performPauseActivity(ActivityThread.java:5683)
       at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:5635)
       at android.app.servertransaction.PauseActivityItem.execute(PauseActivityItem.java:47)
       at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)
       at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176)
       at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2584)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loopOnce(Looper.java:226)
       at android.os.Looper.loop(Looper.java:313)
       at android.app.ActivityThread.main(ActivityThread.java:8810)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:604)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
        
@anandwana001 anandwana001 added the type: bug Something isn't working label Jan 13, 2025
@anandwana001
Copy link
Collaborator Author

@shobhitagarwal1612 Will this get solved in any ongoing PR?

@shobhitagarwal1612
Copy link
Member

You can assign this one to me. I'm already working towards improving the reliability of this class. Will check if this error can be handled along with my changes or not.

@shobhitagarwal1612 shobhitagarwal1612 self-assigned this Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

2 participants