#11436·NativeScript

[Bug] Android frames are missing from frame stack after backpress and app resume

Author: CatchABusCreated Sep 16, 2026Updated Sep 16, 2026
Labelsbug-pending-triage

Issue Description

In android 12 and later, root launcher activities are no longer finished on Back press. See https://developer.android.com/about/versions/12/behavior-changes-all#activity-lifecycle

However, {N} core overrides backpress and removes frames from stack, thinking that the activity will finish. Then, user attempts to launch the app and it will simply resume without recreating views and frames will still be missing from the stack.

That is because the frame stack implementation is very old and did not consider the more recent android 12 behaviour. The issue affects Frame.topmost() and Frame.getFrameById().

This can be replicated in apps with multiple frame instances as back press makes sure core keeps at least a single frame in the stack.

Reproduction

  1. Launch an app with a frame that has an id in android 12 or later
  2. Log result from Frame.getFrameById(id) which should print the frame view
  3. Press back to close application
  4. Launch app again and it will still be in the last navigated page
  5. Log result from Frame.getFrameById(id) and it will be undefined

Relevant log output (if applicable)

bash

Environment

No response

Please accept these terms

Source: NativeScript/NativeScript