From e5f110fe5c781689401533bbafe0d37374d7c100 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 0322aaf3c..71e39e4b7 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`);