bugsnag / bugsnag-js

JavaScript error handling tool for BugSnag. Monitor and report JavaScript bugs & errors.
https://docs.bugsnag.com/platforms/javascript
MIT License
856 stars 251 forks source link

Can't report error coming from Android(React Native) release build #2230

Open cloudy-ninja opened 1 month ago

cloudy-ninja commented 1 month ago

Describe the bug

Reporting an error on debug mode is working as expected and we can find it on the Bugsnag dashboard, but not on the release build. It looks like sending bugs to bugsnag works but can't see those on bugsnag dashboard only in release mode.

Steps to reproduce

The following is the code block to notify an error

<Button
  title="Report error to Bugsnag"
  onPress={() => {
    const estDate = new Date().toLocaleString('en-US', {
      timeZone: 'America/New_York',
    });
    Bugsnag.notify(
      new Error(
        `Test error coming from ${ENVIRONMENT}: ${pkg.version} - ${estDate}`,
      ),
    );
  }}
/>

Environment

Android Studio Logs when clicking on the Report error to Bugsnag button

Screenshot 2024-10-17 at 11 02 34

cloudy-ninja commented 1 month ago

I was able to reproduce this issue with a fresh project. The steps to reproduce

  1. @react-native-community/cli@latest init AwesomeProject
  2. Added @bugsnag/react-native 8.0.0
  3. For Android, we can receive incoming errors in debug mode on the Bugsnag dashboard but not in release mode.

I'm looking forward to your quick response Thank you!

RobertoSmartBear commented 1 month ago

HI @cloudy-ninja,

I see you are already in contact with our support with the same request. I have reported your last comment to our engineers but, just to avoid confusion, we will go on with the troubleshooting on the ticket and then publish the result here, once resolved.

andrei-tofan commented 1 week ago

Hello,

I'm having a similar issue, checked the documentation and everything is configured correctly, any idea why this is happening?

andrei-tofan commented 1 week ago

I think there is an issue with the latest version of bugsnag-android had to downgrade 1 version and use v6.9.0.

While debugging, found that the latest version when the native code is called to configure it returns an object with all properties undefined, including the api key.

mclack commented 17 hours ago

Hi @andrei-tofan

The latest version of our React Native SDK is not yet compatible with bugsnag-android v6.10.0. Due to this, we would recommend not overriding the version of bugsnag-android within your build.gradle, and instead let the dependency resolve to v6.6.1, as defined in the bugsnag-js package: https://github.com/bugsnag/bugsnag-js/blob/c80842fce5b01cce8e2b61e405d19aa0564ff28f/packages/react-native/android/build.gradle#L48

If you continue to have issues after using the latest compatible version of bugsnag-android, please feel free to open a ticket with us directly by contacting support@bugsnag.com, along with any relevant information for our further investigation (such as your version of bugsnag-js + bugsnag-android, any error messages, code snippets of BugSnag config + build.gradle dependencies etc), and we'll be happy to look into it for you.