调用js方法onDestroy失败

Calling js method onDestroy failed

我正在尝试发布我的应用,但是,Google 播放预发布报告 return 这个 Error: View not added to this instance. View: t(73) CurrentParent: t(69) ExpectedParent: t(66)。这个错误发生了多次。我确实在每个组件上添加了 onDestroy

该应用程序只是从 Wordpress 复制网页。 (客户要求)。 我使用 WebView 组件来实现。

应用更改后,数量错误减少到 1。现在,只发生在 Galaxy S9 中。

嗯,现在我不知道在哪里可以解决这个问题。

此处错误:

FATAL EXCEPTION: main
Process: org.fcoe.iplan, PID: 26666
java.lang.RuntimeException: Unable to destroy activity {org.fcoe.iplan/com.tns.NativeScriptActivity}: com.tns.NativeScriptException: Calling js method onDestroy failed
Error: View not added to this instance. View: t(73) CurrentParent: t(69) ExpectedParent: t(66)
    at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4603)
    at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4621)
    at android.app.ActivityThread.-wrap5(Unknown Source:0)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1757)
    at android.os.Handler.dispatchMessage(Handler.java:105)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6938)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
Caused by: com.tns.NativeScriptException: Calling js method onDestroy failed
Error: View not added to this instance. View: t(73) CurrentParent: t(69) ExpectedParent: t(66)
    at com.tns.Runtime.callJSMethodNative(Native Method)
    at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1286)
    at com.tns.Runtime.callJSMethodImpl(Runtime.java:1173)
    at com.tns.Runtime.callJSMethod(Runtime.java:1160)
    at com.tns.Runtime.callJSMethod(Runtime.java:1138)
    at com.tns.Runtime.callJSMethod(Runtime.java:1134)
    at com.tns.NativeScriptActivity.onDestroy(NativeScriptActivity.java:39)
    at android.app.Activity.performDestroy(Activity.java:7462)
    at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1255)
    at androidx.test.runner.MonitoringInstrumentation.callActivityOnDestroy(MonitoringInstrumentation.java:1)
    at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4590)
    ... 9 more

我的同事建议在 app.component.html 中的 <page-router-outlet></page-router-outlet> 周围添加 StackLayout 标签。

我采纳了他的建议,在 Google 播放测试中一切正常。 这里的代码如下所示:

<StackLayout>
    <page-router-outlet></page-router-outlet>
</StackLayout>