From 4dc35a5e6ff122e6eb20e4de91eba1765d124f00 Mon Sep 17 00:00:00 2001 From: Manol Donev Date: Tue, 18 Dec 2018 10:23:02 +0200 Subject: [PATCH] fix(android): failure saving state in mixed parent/nested frame nav (#6719) --- tns-core-modules/ui/frame/frame.android.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tns-core-modules/ui/frame/frame.android.ts b/tns-core-modules/ui/frame/frame.android.ts index 28967e222f..d2e3c99433 100644 --- a/tns-core-modules/ui/frame/frame.android.ts +++ b/tns-core-modules/ui/frame/frame.android.ts @@ -903,6 +903,12 @@ class FragmentCallbacksImplementation implements AndroidFragmentCallbacks { return null; } + // [nested frames / fragments] see https://github.com/NativeScript/NativeScript/issues/6629 + // retaining reference to a destroyed fragment here somehow causes a cryptic + // "IllegalStateException: Failure saving state: active fragment has cleared index: -1" + // in a specific mixed parent / nested frame navigation scenario + entry.fragment = null; + const page = entry.resolvedPage; if (!page) { traceError(`${fragment}.onDestroy: entry has no resolvedPage`);