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

App Crash - Data Collection Screen - Orientation Change #2682

Closed
Tracked by #2624
anandwana001 opened this issue Aug 22, 2024 · 2 comments
Closed
Tracked by #2624

App Crash - Data Collection Screen - Orientation Change #2682

anandwana001 opened this issue Aug 22, 2024 · 2 comments
Assignees
Labels
type: bug Something isn't working
Milestone

Comments

@anandwana001
Copy link
Collaborator

Describe the bug
While collecting data for DropPinTaskMapFragment, If we rotate the device, the app gets crashes with following logs

FATAL EXCEPTION: main (Ask Gemini)
Process: com.google.android.ground, PID: 4605
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.google.android.ground/com.google.android.ground.MainActivity}: androidx.fragment.app.Fragment$InstantiationException: Unable to instantiate fragment com.google.android.ground.ui.datacollection.tasks.point.DropPinTaskMapFragment: could not find Fragment constructor
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4047)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4234)
at android.app.ActivityThread.handleRelaunchActivityInner(ActivityThread.java:6303)
at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:6194)
at android.app.servertransaction.ActivityRelaunchItem.execute(ActivityRelaunchItem.java:79)
at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:60)
at android.app.servertransaction.TransactionExecutor.executeNonLifecycleItem(TransactionExecutor.java:174)
at android.app.servertransaction.TransactionExecutor.executeTransactionItems(TransactionExecutor.java:109)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:81)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2635)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at android.app.ActivityThread.main(ActivityThread.java:8699)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:886)
Caused by: androidx.fragment.app.Fragment$InstantiationException: Unable to instantiate fragment com.google.android.ground.ui.datacollection.tasks.point.DropPinTaskMapFragment: could not find Fragment constructor
at androidx.fragment.app.Fragment.instantiate(Fragment.java:692)
at androidx.fragment.app.FragmentContainer.instantiate(FragmentContainer.java:57)
at androidx.fragment.app.FragmentManager$3.instantiate(FragmentManager.java:662)
at androidx.fragment.app.FragmentState.instantiate(FragmentState.java:87)
at androidx.fragment.app.FragmentStateManager.<init>(FragmentStateManager.java:92)
at androidx.fragment.app.FragmentManager.restoreSaveStateInternal(FragmentManager.java:2789)
at androidx.fragment.app.Fragment.restoreChildFragmentState(Fragment.java:1993)
at androidx.fragment.app.Fragment.onCreate(Fragment.java:1972)
at com.google.android.ground.ui.common.AbstractFragment.onCreate(AbstractFragment.kt:56)
at androidx.fragment.app.Fragment.performCreate(Fragment.java:3099)
at androidx.fragment.app.FragmentStateManager.create(FragmentStateManager.java:524)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:282)
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.dispatchCreate(FragmentManager.java:3166)
at androidx.fragment.app.Fragment.restoreChildFragmentState(Fragment.java:1994)
at androidx.fragment.app.Fragment.onCreate(Fragment.java:1972)
at androidx.navigation.fragment.NavHostFragment.onCreate(NavHostFragment.kt:163)
at androidx.fragment.app.Fragment.performCreate(Fragment.java:3099)
at androidx.fragment.app.FragmentStateManager.create(FragmentStateManager.java:524)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:282)
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)
2024-08-22 11:38:33.395  4605-4605  AndroidRuntime          com.google.android.ground            E  	at androidx.fragment.app.FragmentManager.dispatchCreate(FragmentManager.java:3166) (Ask Gemini)
at androidx.fragment.app.FragmentController.dispatchCreate(FragmentController.java:252)
at androidx.fragment.app.FragmentActivity.onCreate(FragmentActivity.java:219)
at com.google.android.ground.AbstractActivity.onCreate(AbstractActivity.kt:34)
at com.google.android.ground.Hilt_MainActivity.onCreate(Hilt_MainActivity.java:58)
at com.google.android.ground.MainActivity.onCreate(MainActivity.kt:73)
at android.app.Activity.performCreate(Activity.java:8980)
at android.app.Activity.performCreate(Activity.java:8958)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1526)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4029)
... 16 more
Caused by: java.lang.NoSuchMethodException: com.google.android.ground.ui.datacollection.tasks.point.DropPinTaskMapFragment.<init> []
at java.lang.Class.getConstructor0(Class.java:3395)
at java.lang.Class.getConstructor(Class.java:2487)
at androidx.fragment.app.Fragment.instantiate(Fragment.java:677)
... 50 more

To Reproduce
Steps to reproduce the behavior:

  1. Click on Collect Data
  2. Rotate the Device
  3. See error

Expected behavior
App should not crash

Actual behavior
App is crashing

@anandwana001 anandwana001 added the type: bug Something isn't working label Aug 22, 2024
@anandwana001 anandwana001 changed the title App Crash - Data Collection Screen App Crash - Data Collection Screen - Orientation Change Aug 22, 2024
@gino-m gino-m added this to the GA release milestone Aug 22, 2024
@anandwana001
Copy link
Collaborator Author

This PR fixing this - #2765

@anandwana001
Copy link
Collaborator Author

Fixed in the #2765

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: Done
Development

No branches or pull requests

2 participants