Repository navigation
Closed as not planned
Closed as not planned
Copy link
Labels
priority: p0Highest priority. Critical issue. P0 implies highest priority.Highest priority. Critical issue. P0 implies highest priority.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
Summary
Running the demo smoke tests on a physical Pixel 4, DemoAppSmokeTest.demoLaunchesAndShowsMap[MapsInLazyColumnActivity] hangs the app and Android shows "android-maps-compose isn't responding". It happened in two separate runs, always on that demo and nowhere else. The same suite passes on the API 36 emulator in CI.
Environment
- Pixel 4, Android 13 (build
TP1A.221005.002.B2), Google Play services 26.43.30 mainat 174f0fd,:maps-app:connectedDebugAndroidTestwithrequireMapLoaded=true- Found while testing test: use the v2 Compose test rules in the maps-app instrumentation tests #1069; it does not depend on it,
DemoAppSmokeTestdoes not use the Compose test rule
What the ANR traces show
Both ANRs are on MapsInLazyColumnActivity (11:17 and 11:48), reported when the screen turned off/on and the app could not handle the broadcast.
- The test runner thread is waiting on the main thread at
DemoAppSmokeTest.kt:137: in the first run inActivityScenario.close()(Instrumentation.waitForIdleSync), in the second one inActivityScenario.launch()(Instrumentation.startActivitySync). - There is no
"main"thread in the dump of the app process. Thetid=1slot belongs to a binder thread (binder:25311_7), while the original main thread (sysTid = pid) is still alive, blocked infutex_wait_queue_me. So the main thread is no longer attached to the runtime, which is what happens when it ends after an uncaught exception. DemoAppSmokeTestreplaces the default uncaught exception handler with one that only records the exception (setUp, lines 118-120). If the main thread throws, the process does not crash: the main thread just stops, and the app hangs until the ANR.LeakCanary-Heap-Dumpwas idle in both dumps, so it is not a heap dump freezing the app.
Launching MapsInLazyColumnActivity by hand on the same phone (without the test handler) works: it loads and stays alive, with no crash in logcat. The only thing logged is Play services saying MapView.onCreate blocked the main thread for 143 ms, which is expected.
Open questions
- What the exception on the main thread is. The handler swallows it and the test hangs before
assertNoUncaughtExceptions()can report it. Since it only happens under the test, the fast launch/close is the main suspect (severalMapViews created and destroyed inside aLazyColumn). - Whether it reproduces on other devices or Android versions.
Proposal
- Make the test handler also log the throwable (or delegate to the original handler for the main thread), so the exception shows up in logcat and the test fails with it instead of hanging.
- Re-run on the Pixel 4 to get the actual exception, then fix
MapsInLazyColumnActivityor the library code behind it.
Metadata
Metadata
Assignees
Labels
priority: p0Highest priority. Critical issue. P0 implies highest priority.Highest priority. Critical issue. P0 implies highest priority.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Activity
kikoso commentedon Nov 3, 2026
Update: I added a
Log.eto the uncaught exception handlers of both smoke tests and re-ranDemoAppSmokeTeston the same Pixel 4, this time with the screen kept on (svc power stayon usb). All 44 cases pass in 2 minutes,MapsInLazyColumnActivityincluded, and nothing is logged by the handler.Both ANRs were reported on a
SCREEN_OFF/SCREEN_ONbroadcast, and the earlier runs were long enough for the screen to time out in the middle. So this looks like the device screen turning off during the run, not a bug in the demo or the library, which also explains why CI (emulators keep the screen on) never sees it. I could not explain why the main thread was missing from the dump, but without a reproduction with the screen on I would not chase it further.I would keep the
Log.ein the handlers anyway, since a swallowed exception on the main thread would otherwise only show up as a hang, and add a note to AGENTS.md to keep the screen on when running the emulator suites on a physical device. If nobody sees it again, I will close this.kikoso commentedon Nov 3, 2026
Closing: with the screen kept on it does not reproduce (44 of 44 pass), so it was the device screen timing out in the middle of the run rather than a bug in the demo or the library. #1071 logs any uncaught exception in the smoke tests and documents keeping the screen on, so if this shows up again the actual exception will be in logcat and we can reopen with it.