getodk / collect

ODK Collect is an Android app for filling out forms. It's been used to collect billions of data points in challenging environments around the world. Contribute and make the world a better place! ✨📋✨
https://docs.getodk.org/collect-intro
Other
718 stars 1.38k forks source link

Crash of the app after minimizing the app or locking the screen while map is loading on geojson form with thousand points used with Mapbox. #5177

Closed dbemke closed 2 years ago

dbemke commented 2 years ago

Software and hardware versions

Android All versions

Problem description

When Mapbox is used as a source of maps on geojson form and the map is loading, minimizing the app or locking the screen causes a crash of the app.

Steps to reproduce the problem

1. Select Mapbox in Settings -> Maps 
2. Download geojson form with thousand points 

geojson.xml.txt thousand-points.geojson.txt

3. Click Select place
4. Minimize the app/ Lock the screen
5. Go back to the app

Expected behavior

Map should load. The app doesn’t crash.

Other information

Checked on geojson form with thousand points.Works well on Google Maps.

seadowg commented 2 years ago

@dbemke is this present in v2022.2.3 and v2022.3 Beta 2? I think we should start specifying the exact versions tested in "Software and hardware versions" as otherwise we need to work out what the "current" version was when the issue was posted.

dbemke commented 2 years ago

@seadowg I've just checked on Adnroid 11 v2022.3 Beta 2 -crash. v2022.2.3 no crash; on Android 8.1 v2022.3 Beta 2 crash, v 2022.2.3 crash

seadowg commented 2 years ago

@dbemke great thanks. Looks like this needs to be marked as a regression then as the crash doesn't occur in the last major release.

seadowg commented 2 years ago

@dbemke I can't seem to reproduce this. Could you post the stack trace you're seeing when it crashes?

dbemke commented 2 years ago

@seadowg Maybe I shouldn't have called this a crash because there is a dialogue with that? osmgeojson2 `022-07-22 12:45:02.311 951-26266/? E/ActivityManager: ANR in org.odk.collect.android (org.odk.collect.android/.activities.FormEntryActivity) PID: 19795 Reason: Input dispatching timed out (f893103 org.odk.collect.android/org.odk.collect.android.activities.FormEntryActivity (server) is not responding. Waited 10000ms for FocusEvent(hasFocus=false)) Parent: org.odk.collect.android/.activities.FormEntryActivity Load: 13.04 / 12.59 / 12.18 ------ Current CPU Core Info ------

seadowg commented 2 years ago

Maybe I shouldn't have called this a crash because there is a dialogue with that?

@dbemke No you're still correct! That's just Android itself telling you there's been a crash.

seadowg commented 2 years ago

@dbemke are you able to reproduce this every time and consistently on different devices? It looks like a performance related crash to me - ANR in org.odk.collect.android (https://developer.android.com/topic/performance/vitals/anr).

dbemke commented 2 years ago

@seadowg (Collect v2022.3 Beta2) Andorid 11: 5 tries- 5 crashed, Android 8.1: 4 tries - 2 crashed

seadowg commented 2 years ago

@dbemke looks like I can reproduce on Android 11 every time (like you're seeing)

seadowg commented 2 years ago

I can't find an exact reason for this, but my theory is that adding markers one by one has finally caught up with us here and actually overloads something. I'll investigate adding markers all at once, like we've talked about before (#5087).