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

0.1.9-Openforis DrawAreaTaskMapFragment App Crash #2725

Closed
anandwana001 opened this issue Sep 17, 2024 · 2 comments · Fixed by #2761
Closed

0.1.9-Openforis DrawAreaTaskMapFragment App Crash #2725

anandwana001 opened this issue Sep 17, 2024 · 2 comments · Fixed by #2761
Assignees
Labels
CERSGIS type: bug Something isn't working
Milestone

Comments

@anandwana001
Copy link
Collaborator

          Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{org.openforis.ground/com.google.android.ground.MainActivity}: androidx.fragment.app.Fragment$InstantiationException: Unable to instantiate fragment com.google.android.ground.ui.datacollection.tasks.polygon.DrawAreaTaskMapFragment: could not find Fragment constructor
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4035)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4201)
       at android.app.ActivityThread.handleRelaunchActivityInner(ActivityThread.java:6347)
       at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:6212)
       at android.app.servertransaction.ActivityRelaunchItem.execute(ActivityRelaunchItem.java:71)
       at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)
       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:2438)
       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:8663)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:567)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
@anandwana001 anandwana001 added the type: bug Something isn't working label Sep 17, 2024
@anandwana001 anandwana001 changed the title 0.1.9-Openforis App Crash 0.1.9-Openforis DrawAreaTaskMapFragment App Crash Sep 17, 2024
@jcqli jcqli added the CERSGIS label Sep 18, 2024
@gino-m gino-m added this to the GA release milestone Sep 19, 2024
@gino-m
Copy link
Collaborator

gino-m commented Sep 19, 2024

DrawAreaTaskMapFragment doesn't have a no-arg constructor, so Android OS won't be able to deserialize it when restoring the view.

@gino-m
Copy link
Collaborator

gino-m commented Sep 19, 2024

Seeing a similar issue with other tasks. This is the second most frequent crash on 0.1.9, with 196 crashes in the last 7 days.

       Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{org.openforis.ground/com.google.android.ground.MainActivity}: androidx.fragment.app.Fragment$InstantiationException: Unable to instantiate fragment com.google.android.ground.ui.datacollection.tasks.location.CaptureLocationTaskMapFragment: could not find Fragment constructor
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4164)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4322)
       at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103)
       at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:139)
       at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:96)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2685)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loopOnce(Looper.java:230)
       at android.os.Looper.loop(Looper.java:319)
       at android.app.ActivityThread.main(ActivityThread.java:8919)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)

All custom Fragments in the app must have a default constructor. If we need to set a ViewModel then we should do it outside the contructor.

@anandwana001 PTAL?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CERSGIS type: bug Something isn't working
Projects
Status: Done
4 participants