Nativescript-plugin-firebase: When I received Backgound Notification, I opened App firstly then Notification... ERROR then

Created on 24 Oct 2019  路  1Comment  路  Source: EddyVerbruggen/nativescript-plugin-firebase

When I receive a background notification, I don't open it, but I first open the application then I click the background notification. this error occurred.

How to solve it?

System.err: An uncaught Exception occurred on "main" thread.
System.err: Unable to destroy activity {com.renzocastro.demo/com.tns.NativeScriptActivity}: com.tns.NativeScriptException: Calling js method onDestroy failed
System.err: Error: View not added to this instance. View: Frame(4) CurrentParent: undefined ExpectedParent: AppHostView(1)
System.err: StackTrace:
System.err: java.lang.RuntimeException: Unable to destroy activity {com.renzocastro.demo/com.tns.NativeScriptActivity}: com.tns.NativeScriptException: Calling js method onDestroy failed
System.err: Error: View not added to this instance. View: Frame(4) CurrentParent: undefined ExpectedParent: AppHostView(1)
System.err: at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3655)
System.err: at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3673)
System.err: at android.app.ActivityThread.access$1200(ActivityThread.java:148)
System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1408)
System.err: at android.os.Handler.dispatchMessage(Handler.java:99)
System.err: at android.os.Looper.loop(Looper.java:150)
System.err: at android.app.ActivityThread.main(ActivityThread.java:5390)
System.err: at java.lang.reflect.Method.invokeNative(Native Method)
System.err: at java.lang.reflect.Method.invoke(Method.java:525)
System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
System.err: at dalvik.system.NativeStart.main(Native Method)
System.err: Caused by: com.tns.NativeScriptException: Calling js method onDestroy failed
System.err: Error: View not added to this instance. View: Frame(4) CurrentParent: undefined ExpectedParent: AppHostView(1)
System.err: at com.tns.Runtime.callJSMethodNative(Native Method)
System.err: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1209)
System.err: at com.tns.Runtime.callJSMethodImpl(Runtime.java:1096)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1083)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1063)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1055)
System.err: at com.tns.NativeScriptActivity.onDestroy(NativeScriptActivity.java:39)
System.err: at android.app.Activity.performDestroy(Activity.java:5472)
System.err: at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1117)
System.err: at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3642)
System.err: ... 11 more
ActivityManager: Process com.renzocastro.demo (pid 8763) has died.

Most helpful comment

Add android:launchMode="singleInstance" inside your AndroidManifest.xml

Example:

<application
    ...
    <activity
        ...
        android:launchMode="singleInstance">
                ...
        </activity>

>All comments

Add android:launchMode="singleInstance" inside your AndroidManifest.xml

Example:

<application
    ...
    <activity
        ...
        android:launchMode="singleInstance">
                ...
        </activity>
Was this page helpful?
0 / 5 - 0 ratings