ground-android
ground-android copied to clipboard
Consecutive geometry tasks fails to render (com.google.maps.api.android.lib6.impl.as cannot be cast to android.view.ViewGroup)
Describe the bug
Received the following error when two subsequent location tasks are being rendered: the map doesn't render and we see this in the stack trace:
java.lang.ClassCastException: com.google.maps.api.android.lib6.impl.as cannot be cast to android.view.ViewGroup
at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:537)
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:1839)
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:958)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:205)
at android.os.Looper.loop(Looper.java:294)
at android.app.ActivityThread.main(ActivityThread.java:8177)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)
I placed breakpoints at the exact line where the crash occurs and inspected the thing that was failing to cast as a ViewGroup. It turns out that the crash happens when it tries to render the compass of all things!
It happens specifically when I try to render the DrawAreaTaskFragment before or after a drop pin LOI task.
When I just have a Draw Area LOI task and no other, then it seems to work
To Reproduce Steps to reproduce the behavior:
- Publish a survey with the default capture location task and then an ad-hoc LOI task (e.g. capture location again).
- Zoom in and start a job, then see that the first task, the default capture task, is broken with a white screen.
Expected behavior
- The map is rendered.