google-play - 调用 js 方法 onDestroy 失败
问题描述
我正在尝试发布我的应用程序,但是,Google play 发布前报告返回 this 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
解决方案
我的同事建议StackLayout
在<page-router-outlet></page-router-outlet>
.app.component.html
我做了他的建议,在 Google Play 测试中一切正常。这里的代码如下所示:
<StackLayout>
<page-router-outlet></page-router-outlet>
</StackLayout>
推荐阅读
- c# - WPF:使用 MVVM 的 SelectAll \ UnSelectAll
- mysql - MySQL使用while循环插入多行函数
- opencv - 使用opencv进行外在矩阵计算
- r - 如何在get函数中定义一个序列?
- typo3 - TYPO3 v9:如何查询额外的外部数据库(MSSQL)
- python - Flask / SQLAlchemy - 请求具有多对多关系的表
- javascript - 一种解析 tmTheme 文件以获取设置的方法?
- java - 在 Java android studio 中解析 json
- url - 如何使用&符号链接到内部链接?
- php - php 与 cdata 中的 xml