Calling js method onDestroy failed

326 views Asked by At

I am trying to publish my app, but, Google play Pre-launch report return this Error: View not added to this instance. View: t(73) CurrentParent: t(69) ExpectedParent: t(66). This error was happens multiple times. I did add onDestroy on each of my components.

The app just reproduce a web page from Wordpress. (Client requirement). I use WebView component to achieve that.

After I apply my changes, the amount error reduced to 1. Now, only happen in Galaxy S9.

Well, at this point I don’t know where can I fix that.

Here the error:

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
1

There are 1 answers

0
Flavio Sampaio On BEST ANSWER

My coworker suggest to add StackLayout tag around <page-router-outlet></page-router-outlet> in app.component.html.

I did his suggestion and all works fine in Google Play tests. Here the code looks like:

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