App doesnt open when clicking notification when app is closed/killed/coldboot

Hi, I´m using Firebase Native for sending and recieving notifications, it works great on web and iOS, but now I´m trying to make it work on android, but:

  1. If the app is on the foreground I can catch notification data and show it on a toast, everything is fine
  2. If the app is open but in the background the notification appears on the notification tray, and when I click it it opens the app, no problem

THE ISSUE:
3) if the app is closed (from the mustitask window) the notification still appears on the not. tray BUT when I try to click it it shows the app with a gray background for half a second and then it closes. if I search on the multitask window it shows as open and If I click it I can open the app as nothing happened, but I need to show the app just after they click it.

I connected my device to android studio and checked the logs on the 3 scenarios, when I get to the 3rd it shows this at the moment of the “crash” (the grey screen and closing) :

I/art: Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.db>: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/webkit/RenderProcessGoneDetail;
at void com.android.webview.chromium.WebViewChromium.init(java.util.Map, boolean) (WebViewChromium.java:48)
at void android.webkit.WebView.(android.content.Context, android.util.AttributeSet, int, int, java.util.Map, boolean) (WebView.java:636)
at void android.webkit.WebView.(android.content.Context, android.util.AttributeSet, int, int) (WebView.java:572)
at void android.webkit.WebView.(android.content.Context, android.util.AttributeSet, int) (WebView.java:555)
at void android.webkit.WebView.(android.content.Context, android.util.AttributeSet) (WebView.java:542)
at void org.apache.cordova.engine.SystemWebView.(android.content.Context, android.util.AttributeSet) (SystemWebView.java:47)
at void org.apache.cordova.engine.SystemWebView.(android.content.Context) (SystemWebView.java:43)
at void org.apache.cordova.engine.SystemWebViewEngine.(android.content.Context, org.apache.cordova.CordovaPreferences) (SystemWebViewEngine.java:76)
at java.lang.Object java.lang.reflect.Constructor.newInstance0!(java.lang.Object[]) (Constructor.java:-2)
at java.lang.Object java.lang.reflect.Constructor.newInstance(java.lang.Object[]) (Constructor.java:430)
at org.apache.cordova.CordovaWebViewEngine org.apache.cordova.CordovaWebViewImpl.createEngine(android.content.Context, org.apache.cordova.CordovaPreferences) (CordovaWebViewImpl.java:80)
at org.apache.cordova.CordovaWebViewEngine org.apache.cordova.CordovaActivity.makeWebViewEngine() (CordovaActivity.java:206)
at org.apache.cordova.CordovaWebView org.apache.cordova.CordovaActivity.makeWebView() (CordovaActivity.java:202)
at void org.apache.cordova.CordovaActivity.init() (CordovaActivity.java:146)
at void org.apache.cordova.CordovaActivity.loadUrl(java.lang.String) (CordovaActivity.java:224)
at void com.fenixdev.VoluntariosApp.MainActivity.onCreate(android.os.Bundle) (MainActivity.java:39)
at void android.app.Activity.performCreate(android.os.Bundle) (Activity.java:6738)
at void android.app.Instrumentation.callActivityOnCreate(android.app.Activity, android.os.Bundle) (Instrumentation.java:1119)
at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:2652)
at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:2766)
at void android.app.ActivityThread.-wrap12(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1)
at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1507)
at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:102)
at void android.os.Looper.loop() (Looper.java:154)
at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6236)
at java.lang.Object java.lang.reflect.Method.invoke!(java.lang.Object, java.lang.Object[]) (Method.java:-2)
at void com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run() (ZygoteInit.java:891)
at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:781)
Caused by: java.lang.ClassNotFoundException: Didn’t find class “android.webkit.RenderProcessGoneDetail” on path: DexPathList[[zip file “/data/app/com.android.chrome-1/base.apk”],nativeLibraryDirectories=[/data/app/com.android.chrome-1/lib/arm64, /data/app/com.android.chrome-1/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]
at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:56)
at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:380)
at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
at void com.android.webview.chromium.WebViewChromium.init(java.util.Map, boolean) (WebViewChromium.java:48)
at void android.webkit.WebView.(android.content.Context, android.util.AttributeSet, int, int, java.util.Map, boolean) (WebView.java:636)
at void android.webkit.WebView.(android.content.Context, android.util.AttributeSet, int, int) (WebView.java:572)
at void android.webkit.WebView.(android.content.Context, android.util.AttributeSet, int) (WebView.java:555)
at void android.webkit.WebView.(android.content.Context, android.util.AttributeSet) (WebView.java:542)
at void org.apache.cordova.engine.SystemWebView.(android.content.Context, android.util.AttributeSet) (SystemWebView.java:47)
at void org.apache.cordova.engine.SystemWebView.(android.content.Context) (SystemWebView.java:43)
at void org.apache.cordova.engine.SystemWebViewEngine.(android.content.Context, org.apache.cordova.CordovaPreferences) (SystemWebViewEngine.java:76)
at java.lang.Object java.lang.reflect.Constructor.newInstance0!(java.lang.Object[]) (Constructor.java:-2)
at java.lang.Object java.lang.reflect.Constructor.newInstance(java.lang.Object[]) (Constructor.java:430)
at org.apache.cordova.CordovaWebViewEngine org.apache.cordova.CordovaWebViewImpl.createEngine(android.content.Context, org.apache.cordova.CordovaPreferences) (CordovaWebViewImpl.java:80)
at org.apache.cordova.CordovaWebViewEngine org.apache.cordova.CordovaActivity.makeWebViewEngine() (CordovaActivity.java:206)
at org.apache.cordova.CordovaWebView org.apache.cordova.CordovaActivity.makeWebView() (CordovaActivity.java:202)
at void org.apache.cordova.CordovaActivity.init() (CordovaActivity.java:146)
at void org.apache.cordova.CordovaActivity.loadUrl(java.lang.String) (CordovaActivity.java:224)
at void com.fenixdev.VoluntariosApp.MainActivity.onCreate(android.os.Bundle) (MainActivity.java:39)
at void android.app.Activity.performCreate(android.os.Bundle) (Activity.java:6738)
at void android.app.Instrumentation.callActivityOnCreate(android.app.Activity, android.os.Bundle) (Instrumentation.java:1119)
at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:2652)
at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:2766)
at void android.app.ActivityThread.-wrap12(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1)
at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1507)
at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:102)
at void android.os.Looper.loop() (Looper.java:154)
at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6236)
at java.lang.Object java.lang.reflect.Method.invoke!(java.lang.Object, java.lang.Object[]) (Method.java:-2)
at void com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run() (ZygoteInit.java:891)
at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:781)
05-23 20:45:27.556 21490-21490/com.fenixdev.VoluntariosApp I/art: Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.hb>: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/webkit/SafeBrowsingResponse;
at void com.android.webview.chromium.WebViewChromium.init(java.util.Map, boolean) (WebViewChromium.java:48)
at void android.webkit.WebView.(android.content.Context, android.util.AttributeSet, int, int, java.util.Map, boolean) (WebView.java:636)
at void android.webkit.WebView.(android.content.Context, android.util.AttributeSet, int, int) (WebView.java:572)
at void android.webkit.WebView.(android.content.Context, android.util.AttributeSet, int) (WebView.java:555)
at void android.webkit.WebView.(android.content.Context, android.util.AttributeSet) (WebView.java:542)
at void org.apache.cordova.engine.SystemWebView.(android.content.Context, android.util.AttributeSet) (SystemWebView.java:47)
at void org.apache.cordova.engine.SystemWebView.(android.content.Context) (SystemWebView.java:43)
at void org.apache.cordova.engine.SystemWebViewEngine.(android.content.Context, org.apache.cordova.CordovaPreferences) (SystemWebViewEngine.java:76)
at java.lang.Object java.lang.reflect.Constructor.newInstance0!(java.lang.Object[]) (Constructor.java:-2)
at java.lang.Object java.lang.reflect.Constructor.newInstance(java.lang.Object[]) (Constructor.java:430)
at org.apache.cordova.CordovaWebViewEngine org.apache.cordova.CordovaWebViewImpl.createEngine(android.content.Context, org.apache.cordova.CordovaPreferences) (CordovaWebViewImpl.java:80)
at org.apache.cordova.CordovaWebViewEngine org.apache.cordova.CordovaActivity.makeWebViewEngine() (CordovaActivity.java:206)
at org.apache.cordova.CordovaWebView org.apache.cordova.CordovaActivity.makeWebView() (CordovaActivity.java:202)
05-23 20:45:27.557 21490-21490/com.fenixdev.VoluntariosApp I/art: at void org.apache.cordova.CordovaActivity.init() (CordovaActivity.java:146)
at void org.apache.cordova.CordovaActivity.loadUrl(java.lang.String) (CordovaActivity.java:224)
at void com.fenixdev.VoluntariosApp.MainActivity.onCreate(android.os.Bundle) (MainActivity.java:39)
at void android.app.Activity.performCreate(android.os.Bundle) (Activity.java:6738)
at void android.app.Instrumentation.callActivityOnCreate(android.app.Activity, android.os.Bundle) (Instrumentation.java:1119)
at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:2652)
at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:2766)
at void android.app.ActivityThread.-wrap12(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1)
at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1507)
at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:102)
at void android.os.Looper.loop() (Looper.java:154)
at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6236)
at java.lang.Object java.lang.reflect.Method.invoke!(java.lang.Object, java.lang.Object[]) (Method.java:-2)
at void com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run() (ZygoteInit.java:891)
at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:781)
Caused by: java.lang.ClassNotFoundException: Didn’t find class “android.webkit.SafeBrowsingResponse” on path: DexPathList[[zip file “/data/app/com.android.chrome-1/base.apk”],nativeLibraryDirectories=[/data/app/com.android.chrome-1/lib/arm64, /data/app/com.android.chrome-1/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]
at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:56)
at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:380)
at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
at void com.android.webview.chromium.WebViewChromium.init(java.util.Map, boolean) (WebViewChromium.java:48)
at void android.webkit.WebView.(android.content.Context, android.util.AttributeSet, int, int, java.util.Map, boolean) (WebView.java:636)
at void android.webkit.WebView.(android.content.Context, android.util.AttributeSet, int, int) (WebView.java:572)
at void android.webkit.WebView.(android.content.Context, android.util.AttributeSet, int) (WebView.java:555)
at void android.webkit.WebView.(android.content.Context, android.util.AttributeSet) (WebView.java:542)
at void org.apache.cordova.engine.SystemWebView.(android.content.Context, android.util.AttributeSet) (SystemWebView.java:47)
at void org.apache.cordova.engine.SystemWebView.(android.content.Context) (SystemWebView.java:43)
at void org.apache.cordova.engine.SystemWebViewEngine.(android.content.Context, org.apache.cordova.CordovaPreferences) (SystemWebViewEngine.java:76)
at java.lang.Object java.lang.reflect.Constructor.newInstance0!(java.lang.Object[]) (Constructor.java:-2)
at java.lang.Object java.lang.reflect.Constructor.newInstance(java.lang.Object[]) (Constructor.java:430)
at org.apache.cordova.CordovaWebViewEngine org.apache.cordova.CordovaWebViewImpl.createEngine(android.content.Context, org.apache.cordova.CordovaPreferences) (CordovaWebViewImpl.java:80)
at org.apache.cordova.CordovaWebViewEngine org.apache.cordova.CordovaActivity.makeWebViewEngine() (CordovaActivity.java:206)
at org.apache.cordova.CordovaWebView org.apache.cordova.CordovaActivity.makeWebView() (CordovaActivity.java:202)
at void org.apache.cordova.CordovaActivity.init() (CordovaActivity.java:146)
at void org.apache.cordova.CordovaActivity.loadUrl(java.lang.String) (CordovaActivity.java:224)
at void com.fenixdev.VoluntariosApp.MainActivity.onCreate(android.os.Bundle) (MainActivity.java:39)
at void android.app.Activity.performCreate(android.os.Bundle) (Activity.java:6738)
at void android.app.Instrumentation.callActivityOnCreate(android.app.Activity, android.os.Bundle) (Instrumentation.java:1119)
at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:2652)
at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:2766)
at void android.app.ActivityThread.-wrap12(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1)
at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1507)
at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:102)
at void android.os.Looper.loop() (Looper.java:154)
at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6236)
at java.lang.Object java.lang.reflect.Method.invoke!(java.lang.Object, java.lang.Object[]) (Method.java:-2)
at void com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run() (ZygoteInit.java:891)
at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:781)

Do you have any ideas how to solve this? any help would be really apreciatted

Hi, Iam also acin same problem. Can anyone clear the problem Akshay Trainings