Skip to content

MapsInLazyColumnActivity hangs the demo app in DemoAppSmokeTest on a Pixel 4 (Android 13) #1070

Closed as not planned

Description

@kikoso

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

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 in ActivityScenario.close() (Instrumentation.waitForIdleSync), in the second one in ActivityScenario.launch() (Instrumentation.startActivitySync).
  • There is no "main" thread in the dump of the app process. The tid=1 slot belongs to a binder thread (binder:25311_7), while the original main thread (sysTid = pid) is still alive, blocked in futex_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.
  • DemoAppSmokeTest replaces 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-Dump was 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 (several MapViews created and destroyed inside a LazyColumn).
  • Whether it reproduces on other devices or Android versions.

Proposal

  1. 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.
  2. Re-run on the Pixel 4 to get the actual exception, then fix MapsInLazyColumnActivity or the library code behind it.

Activity

  1. added
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    on Nov 3, 2026
  2. added
    priority: p0Highest priority. Critical issue. P0 implies highest priority.
    on Nov 3, 2026
  3. kikoso commented on Nov 3, 2026

    @kikoso
    CollaboratorAuthor

    Update: I added a Log.e to the uncaught exception handlers of both smoke tests and re-ran DemoAppSmokeTest on the same Pixel 4, this time with the screen kept on (svc power stayon usb). All 44 cases pass in 2 minutes, MapsInLazyColumnActivity included, and nothing is logged by the handler.

    Both ANRs were reported on a SCREEN_OFF/SCREEN_ON broadcast, 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.e in 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.

  4. kikoso commented on Nov 3, 2026

    @kikoso
    CollaboratorAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: p0Highest priority. Critical issue. P0 implies highest priority.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions