Closed sufyanAbbasi closed 1 month ago
This is unfortunately blocking the end to end tests as well as exasperated by the fact that we always have a capture location task as the first task by default, since ad-hoc surveys will always put the loiTask afterwards
Ok, I found the problem, it is so silly...
Here we create a RowLayout
with a generated ID that is usually 0x5
, that is, it returns the next ID that has not been assigned. However, when we go to render it here, the GoogleMapsFragment
is also rendered on the page, so when we try to look for the container by ID, there is a Compass element on the GoogleMaps which also has ID 0x5
, so at render time, it finds the Compass element, i.e., com.google.maps.api.android.lib6.impl.as
, from the GoogleMapsFragment instead of the newly created RowLayout!
When I arbitrarily added 10,000 to the ID, the crash is prevented, hence I believe this is an ID conflict problem.
The fix is to fuzz the ID numbers to decrease the chance of collisions, or somehow get it to always find the RowLayout element every time, maybe there's a different add
we could do? Not really sure.
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:
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:
Expected behavior