Skip to content

iOS: prebuilt Frame tree with inherited CSS direction triggers UIKit targetNode assertion #11586

Open

Description

@rafaelaugustos

Reproduction: Core only, no renderer or router

A native tree assembled before Application.run() with inherited CSS direction="ltr" around a Frame terminates when a TextField on a pushed Page is tapped. Constructing the identical tree inside the application factory passes keyboard input and reversed/committed native Back.

Core 9.1.3, iOS runtime 9.1.0; reproduced on iPhone 16 / iOS 18.6 and iPad Pro 11-inch M4 / iPadOS 18.6 simulators. This entry imports only @nativescript/core: no NativeScript-Vue, router, Drawer, leave guard, custom recognizer or delegate override.

Pinned project: https://github.com/rafaelaugustos/vue-router-ns/tree/2ad9f1e/examples/ios-direction-repro
Core-only entry: https://github.com/rafaelaugustos/vue-router-ns/blob/2ad9f1e/examples/ios-direction-repro/src/app.js
Native results and real demonstration video: rafaelaugustos/vue-router-ns#158

cd examples/ios-direction-repro
npm ci
node scripts/resources.mjs
ns build ios   # default Core-only entry; no --env.vue / --env.router
xcrun simctl install SIMULATOR platforms/ios/build/Debug-iphonesimulator/iosdirectionrepro.app
xcrun simctl launch SIMULATOR org.nativescript.directionrepro direction-mode=prebuilt-ltr

Tap Push detail, then Draft: app terminates. Terminate/relaunch with direction-mode=inherited-ltr: the same Core tree built inside the factory passes the full native interaction test. direction-mode=prebuilt-none also passes. The locked project includes Vue/router dependencies only for separate comparison entries; this default entry does not import them.

The decisive order difference, using the same createRoot():

// Passing control
Application.run({ create: createRoot })

// Failing alternative run
const root = createRoot() // includes inherited LTR, Frame and initial navigation
Application.run({ create: () => root })

Original native exception

LLDB attached to the Core-only iPhone run, breakpoint objc_exception_throw:

Invalid parameter not satisfying: targetNode
-[UIGestureGraphEdge initWithLabel:sourceNode:targetNode:directed:]
-[UIGestureGraph addUniqueEdgeWithLabel:sourceNode:targetNode:directed:properties:]
_UIGestureEnvironmentUpdate
-[UIGestureEnvironment _deliverEvent:toGestureRecognizers:usingBlock:]

The later NativeScript EXC_BAD_ACCESS/exception-conversion failure and XCTest reporting “application is not running” are secondary symptoms.

Controls and limits

  • Factory-built inherited LTR: passes on iPhone and iPad, including typing and reversed/committed Back.
  • Prebuilt tree without direction: passes on both.
  • Prebuilt tree with inherited LTR: reproduces on both.
  • iPhone-only controls also pass: explicit ActionBar instances; navigation queued before Frame attachment inside the factory; only Frame created before startup; only root layout created before startup; prebuilt tree with LTR assigned on root loaded.
  • The late-direction variant is a diagnostic control, not a proposed global workaround. Dynamic RTL, other hosts and physical devices are not certified by these runs. No production patch is included yet.

This corrects the earlier reduction in nativescript-vue/nativescript-vue#1186: its Core controls were created inside the application factory and therefore missed this initialization-order condition. Vue is not required to reproduce it. Downstream tracking: rafaelaugustos/vue-router-ns#139.

The XCTest runner keeps testPrebuiltLTR deliberately failing; it does not mask the defect by disabling interactive Back. The remaining question is why the prebuilt inherited-direction tree creates this invalid UIKit gesture relationship and where Core can safely prevent it.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions