question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android crashes when receiving notification

See original GitHub issue

I’m running into the following issue when using the latest react-native-fcm@1.0.16 and react-native@0.30

I have setup the package as outlined in the documentation with the only thing still not quite clear to me whether to add the public onNewIntent() method to MainActivity.java. i get the same crash whether i add it or not though so it does not seem to make a difference.

I thnk the docs are a bit unclear here since RN>0.29 apps now use MainApplication.java for additional activity methods as far as i can tell.

Either way, what happens is; while notifications are received fine on the device (tested on simulator) once a notification is received when the app is not in focus or started and you start the app it immediately crashes.

I get the following stack trace from Android Studio:

07-28 16:13:53.355 4733-4733/? E/AndroidRuntime: FATAL EXCEPTION: main
                                                 Process: com.florinapp.florinapp.debug, PID: 4733
                                                 java.lang.AbstractMethodError: abstract method "void com.facebook.react.bridge.ActivityEventListener.onNewIntent(android.content.Intent)"
                                                     at com.facebook.react.bridge.ReactContext.onNewIntent(ReactContext.java:169)
                                                     at com.facebook.react.ReactInstanceManagerImpl.onNewIntent(ReactInstanceManagerImpl.java:483)
                                                     at com.facebook.react.ReactActivity.onNewIntent(ReactActivity.java:183)
                                                     at android.app.Instrumentation.callActivityOnNewIntent(Instrumentation.java:1223)
                                                     at android.app.Instrumentation.callActivityOnNewIntent(Instrumentation.java:1235)
                                                     at android.app.ActivityThread.deliverNewIntents(ActivityThread.java:2783)
                                                     at android.app.ActivityThread.performNewIntents(ActivityThread.java:2795)
                                                     at android.app.ActivityThread.handleNewIntent(ActivityThread.java:2804)
                                                     at android.app.ActivityThread.-wrap15(ActivityThread.java)
                                                     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1539)
                                                     at android.os.Handler.dispatchMessage(Handler.java:102)
                                                     at android.os.Looper.loop(Looper.java:154)
                                                     at android.app.ActivityThread.main(ActivityThread.java:6077)
                                                     at java.lang.reflect.Method.invoke(Native Method)
                                                     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
                                                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:32 (15 by maintainers)

github_iconTop GitHub Comments

2reactions
evollucommented, Jul 29, 2016

it is image picker

1reaction
tijscommented, Jul 30, 2016

yup that was it. thanks again!

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Android] Native crash if a push notification has been received
Issue Hi there. Let me describe the problem. I am using react-native-firebase and firebase console in order to send push notifications.
Read more >
Detect and diagnose crashes - Android Developers
An Android app crashes whenever there's an unexpected exit caused by an unhandled exception or signal. An app that is written using Java...
Read more >
Android app crashing while creating notifications in Version S+
I have been using notifications in my app for a while now and everything was working fine until i recently targeted android 12....
Read more >
[Solved] Android app crash when one signal notification sent
It crashes because of the. java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String
Read more >
2.8.31 - Crash when opening a push notification and app not ...
Things also work when the app is already running in the foreground - I get a Notification Received event. I'm seeing this on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found