Sentry-react-native: @sentry/react-native - Tracking Issue - Feedback

Created on 3 Jul 2019  ·  164Comments  ·  Source: getsentry/sentry-react-native

We just released the new version of our React Native SDK @sentry/[email protected] and we are looking for people to try it out and provide feedback.
https://www.npmjs.com/package/@sentry/react-native

  • [x] Support for react-native >= 0.60
  • [x] Use @sentry/browser
  • [x] Supports autolinking
  • [x] Supports ram bundles
  • [ ] Supports hermes

How to install it?

If you already have an existing React Native project install it with yarn like:

yarn add @sentry/[email protected]

If you are using react-native <0.60 do:

react-native link @sentry/react-native

If react-native >=0.60 do:

yarn sentry-wizard -i reactNative -p ios android

After that, you need to

cd ios
pod install

always for project >= 0.60 and only if you have a Cocoapods setup if you run below 0.60.

What changed?

@sentry/react-native now joins the unified family and has pretty much the same API as @sentry/browser. There are also some internal improvements that should make the overall experience when using the SDK more stable and robust.

The new SDK is fully written in typescript and therefore provides full typing out of the box.

Upgrading from react-native-sentry

You first need to unlink the package like react-native unlink react-native-sentry.
Then remove it from your dependencies yarn remove react-native-sentry.

There are some code changes necessary you need to import and init the new SDK like this:

import * as Sentry from '@sentry/react-native';

Sentry.init({ 
  dsn: 'DSN', 
});

You can remove the code in your AppDelegate.m

#import <React/RNSentry.h>
...
- (BOOL)application:(UIAppl...
{
  ...
  [RNSentry installWithRootView:rootView];
  ...
}

CodePush

The function Sentry.setVersion has been dropped in favor of Sentry.setRelease (which exactly sets the string you set as the release name, without any magic).
Same goes for Sentry.setDist, it just sets the dist to the string you set.

Why?

Reason for this change is that since the initial release of our React Native SDK a lot has changed on both our and React Native side. We wanted to make sure that we can keep up with the pace and future features that are yet to come for Sentry.

New Features

On device symbolcation for Debug builds

We now have an integration that runs only in debug doing symbolication on the device. Providing a better stack trace for debug builds with correct line numbers and filenames for application frames.

Before
before

After
after

Whishlist

  • [x] Use symbolicateStackTrace of react-native to symbolicate on device in Debug.
  • [ ] Check stacktrace merging
@sentrreact-native

Most helpful comment

@HazAT
React-native: 0.60.3
Sentry: 1.0.0-beta.4

Sorry I put it after sentry command. Here the output:

> Task :app:bundleReleaseJsAndAssets_SentryUpload FAILED
  INFO    2019-07-30 10:58:59.038668 +02:00 Loaded config from /Users/Michele/.sentryclirc
  DEBUG   2019-07-30 10:58:59.039943 +02:00 sentry-cli version: 1.47.0, platform: "darwin", architecture: "x86_64"
  INFO    2019-07-30 10:58:59.040004 +02:00 sentry-cli was invoked with the following command line: "/Users/Michele/Documents/Wanderio/app-android/node_modules/@sentry/cli/sentry-cli" "--log-level" "debug" "react-native" "gradle" "--bundle" "/Users/Michele/Documents/Wanderio/app-android/android/app/build/generated/assets/react/release/index.android.bundle" "--sourcemap" "/Users/Michele/Documents/Wanderio/app-android/android/app/build/intermediates/sourcemaps/release/index.android.bundle.packager.map" "--release" "com.wanderio-1.9.7" "--dist" "61"
Processing react-native sourcemaps for Sentry upload.
  INFO    2019-07-30 10:58:59.045779 +02:00   bundle path: /Users/Michele/Documents/Wanderio/app-android/android/app/build/generated/assets/react/release/index.android.bundle
  INFO    2019-07-30 10:58:59.045811 +02:00   sourcemap path: /Users/Michele/Documents/Wanderio/app-android/android/app/build/intermediates/sourcemaps/release/index.android.bundle.packager.map
  DEBUG   2019-07-30 10:58:59.046408 +02:00 Non-file bundle found
> Analyzing 2 sources
  DEBUG   2019-07-30 10:58:59.047522 +02:00 error: running update nagger
  DEBUG   2019-07-30 10:58:59.047553 +02:00 skipping update nagger because session is not attended
error: No such file or directory (os error 2)
  DEBUG   2019-07-30 10:58:59.049194 +02:00 client close; no transport to shut down  (from sentry)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets_SentryUpload'.
> Process 'command 'node_modules/@sentry/cli/bin/sentry-cli'' finished with non-zero exit value 1

All 164 comments

Is it compatible with a newest React Native 0.60v , which has to install dependencies through Pods ?

@Karniej Will give it a try today.

Notifying a few specific ppl to hope to get feedback :)
@pvinis @AleksandrZhukov

ill try it in the next few days! :D

will try to test it today

Cool thanks guys :)
Quick update, coincidentally Facebook released 0.60 a few hours ago https://facebook.github.io/react-native/blog/2019/07/03/version-60
The whole linking process changed, so it will not work out of the box I am working on this now.
It's highly likely that @sentry/react-native will only support react-native >= 0.60

Will update the thread here.

I just released 1.0.0-beta.1 and it should work with react-native >= 0.60

it is compatible with RN < 60?

@AleksandrZhukov Yes, I tried it with both 0.60 and 0.59.
I think it should be compatible as far back as 0.56

I just tried adding the v.0.60 RN Project and still got this alert

[!] Invalid `Podfile` file: 784: unexpected token at '- @sentry/react-native: https://github.com/getsentry/sentry-react-native

Please notify their maintainers about it. You can find more details at https://react-native-community/cli/docs/configuration.md#migration-guide.

@Karniej Please make sure to install it with yarn add @sentry/[email protected] to make sure you use beta.1.
I just tried it with a clean project and it works for me.

@HazAT Ahh yes , I made a mistake here before. This fortunately works now for me :)

@HazAT hey :D how do i install it with npm?

@msqar same as with yarn - npm i @sentry/[email protected]

Hiya,
if i do the pod install i get this error:

`` [!] CocoaPods could not find compatible versions for pod "Sentry": In Podfile: RNSentry (from/Users/xxxx/_Entwicklung/react-native/xxx/node_modules/@sentry/react-native`) was resolved to 1.0.0-beta.1, which depends on
Sentry (~> 4.4.0)

None of your spec sources contain a spec satisfying the dependency: Sentry (~> 4.4.0).

You have either:

  • out-of-date source repos which you can update with pod repo update or with pod install --repo-update.
  • mistyped the name or version.
  • not added the source repo that hosts the Podspec to your Podfile.

Note: as of CocoaPods 1.0, pod repo update does not happen on pod install by default.

````
Unf. i don't really get which [email protected] i need?!

Hiya,
if i do the pod install i get this error:

[!] CocoaPods could not find compatible versions for pod "Sentry":
  In Podfile:
    RNSentry (from `/Users/xxxx/_Entwicklung/react-native/xxx/node_modules/@sentry/react-native`) was resolved to 1.0.0-beta.1, which depends on
      Sentry (~> 4.4.0)

None of your spec sources contain a spec satisfying the dependency: `Sentry (~> 4.4.0)`.

You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default.

Unf. i don't really get which [email protected] i need?!

FYI: Seems "pod repo update" did it also made a gem install cocopods to update from 1.0 to 1.7.3

Does this have Android X support? https://facebook.github.io/react-native/blog/#androidx-support

@cihati Yes, it has AndroidX support.

@HazAT is there already a work-in-progress documentation?
trying to port my old boot up code but can't find any new similar functions/callbacks

Sentry.config(SENTRY_DNS, {allowDuplicates: true}).install()
        .then(() => {
            Sentry.setDataCallback((data) => {
                const newDataExra = {
                    ...data.extra,
                    'state': {My:'Data'}
                };

                return {
                    ...data,
                    extra: newDataExra
                };
            });
        });

I just upgrated to the beta version and it works mostly fine. Only in the dashboard of Android crashes the React Native sourcemaps aren't resolved correctly. They show the error "Source code was not found. Url: app://index.android.bundle". iOS works.

I checked the version and the sourcemaps got uploaded correctly:

grafik

Also the distribution and the release name of the events do match:

grafik

Do you have any ideas?

@saschak42 i get tons of "duplicate symbol" errors.
i guess there must be still some old code in my project?!

Do you also get this messages?!

Bildschirmfoto 2019-07-09 um 16 18 14

@Psiiirus I don't see any of this errors. Where do you see them?

@Psiiirus I don't see any of this errors. Where do you see them?

mhh thats odd, but do you have both libs linked inside your project?!

I've only linked the new one (@sentry/react-native).

Yeah i did too , is was talking abot libRNSentry.a and libSentry.a
i think libRNSentry is the native bridge and libSentry the main sentry library ...but i am not sure

@saschak42 have u updated your sentry implementation or did you implement it totally new into your RN-App?

I've completely unlinked the old one and linked the new one. Also I have used the new init method:

Sentry.init({ 
  dsn: 'https://[email protected]/XXXXX',
  enableNative: true,
  enableNativeCrashHandling: false
});

and I initialize the native SDK within my Android Application to get crashes before RN is initialized:

Sentry.init(
                "https://[email protected]/XXXXX",
                new AndroidSentryClientFactory(this)
        );

Okay , thanks...going to try it again later the day

@Psiiirus
Your code:

Sentry.config(SENTRY_DNS, {allowDuplicates: true}).install()
        .then(() => {
            Sentry.setDataCallback((data) => {
                const newDataExra = {
                    ...data.extra,
                    'state': {My:'Data'}
                };

                return {
                    ...data,
                    extra: newDataExra
                };
            });
        });

should become:

Sentry.init({
  dsn: SENTRY_DNS
});

Sentry.setExtra('state', {My:'Data'});

@saschak42 Can you please paste a link to the event here so I can take a look?

@Psiiirus
Your code:

Sentry.config(SENTRY_DNS, {allowDuplicates: true}).install()
        .then(() => {
            Sentry.setDataCallback((data) => {
                const newDataExra = {
                    ...data.extra,
                    'state': {My:'Data'}
                };

                return {
                    ...data,
                    extra: newDataExra
                };
            });
        });

should become:

Sentry.init({
  dsn: SENTRY_DNS
});

Sentry.setExtra('state', {My:'Data'});

okay i see..is there an equivalent to the setDataCallback so i can hydrate some extra data decoupled to my code?

@saschak42 which RN version do you use? i just can't get a rid of this damn duplicate symbol error.

System:
    OS: macOS 10.14.5
    CPU: (8) x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
    Memory: 3.99 GB / 16.00 GB
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 12.6.0 - /usr/local/bin/node
    Yarn: 1.16.0 - ~/.yarn/bin/yarn
    npm: 6.10.0 - ~/.npm-global/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
    Android SDK:
      API Levels: 23, 25, 26, 27, 28
      Build Tools: 23.0.1, 23.0.2, 25.0.1, 25.0.3, 26.0.1, 26.0.3, 27.0.0, 27.0.3, 28.0.3
      System Images: android-25 | Google Play Intel x86 Atom, android-28 | Intel x86 Atom, android-28 | Intel x86 Atom_64
  IDEs:
    Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.8.6 => 16.8.6 
    react-native: 0.60.0 => 0.60.0 
  npmGlobalPackages:
    react-native-git-upgrade: 0.2.7

@HazAT already dropped the node_modules + bundler folders and reinstalled all deps.
Any idea how to fix this?

FYI: I can start my app if i use Xcode....seems the bug only happens if i run

react-native run-ios  --configuration Debug

@saschak42 Can you please paste a link to the event here so I can take a look?

@HazAT Thanks for the answer. Here is the issue link: https://sentry.io/share/issue/7d21983d127e45cb9a6010553e6ae96a/

@Psiiirus I use RN version 0.59.9.

@saschak42 I need the full link please, not the share one.

@Psiiirus Here is an example, it's the same API
https://codesandbox.io/s/sentrybrowser-addeventprocessor-pho0r

@HazAT thanks so far...i got one last problem...The feedback mechanic has totally changed and the browser-sdk call was obviously no working because its meant to work with a DOM-window, right?
Is this something you gonna takle in the near future?

@Psiiirus I am not sure if I understand correctly.
Like I said the new SDK support the same API so you can do the same things as in the browser SDK.
You can just copy the code, except the import.

Ahh sorry, yeah this one is a different story :/
Could be that we add support for this in the future.

@HazAT my current workround to get feedback is this

....
        Sentry.setEventSentSuccessfully(event => {
            console.log('FeedBack::Sentry.setEventSentSuccessfully');
            const user = this.props.user;
            const reason = this.state.reason;

            if (event.message !== FeedbackPopup.feedbackMessage)
                return;

            const eventID = Sentry.lastEventId();

            let params = {
                event_id: eventID,
                comments: reason,
                name: 'Not Logged In',
                email: '[email protected]'
            };

            if (user) {
                params.name = user.username;
                params.email = user.email;
            }

            fetch(SENTRY_API, {
                method: 'POST',
                headers: {
                    'Content-Type': 'application/json',
                    'Authorization': 'Bearer ' + SENTRY_BEARER,
                },
                body: JSON.stringify(params)
            }).then((e) => {
                    # CLOSE THE FEEDBACK FORM
            });
...

Unf. i cound't find a "Senty.setEventSentSuccessfully" callback... they all preprocessed , right?

@Psiiirus The eventId will be returned from the capture call immediately. We do not give any guarantees for event delivery.
You can use the beforeSend callback
https://docs.sentry.io/enriching-error-data/user-feedback/?platform=browser#collecting-feedback

@Psiiirus The eventId will be returned from the capture call immediately. We do not give any guarantees for event delivery.
You can use the beforeSend callback
https://docs.sentry.io/enriching-error-data/user-feedback/?platform=browser#collecting-feedback

okay, thanks

@saschak42 I need the full link please, not the share one.

I guess this is the right one: https://sentry.io/organizations/dm-34/issues/1104008219/events/80199d042a154fe19207187622183dcf/?project=1497156

@saschak42 Can you try to send an event again? This should actually work, it would be that this event hit Sentry before you uploaded the artifacts.

@HazAT I just did it. But I can't see any difference.

It looks like Sentry.showReportDialog doesn't work yet, correct?

I'm getting

Sentry.showReportDialog is not a function

@bill-pairaktaridis you are right

incidents don't come if i'm build a release APK . If you run through the emulator, incidents are logged

working only (react-native run-android or react-native run-ios)

@saschak42 Thanks I think you found a bug, I published 1.0.0-beta.2 which hopefully fixes the issue.

also if type react-native run-android no source code (this is clean RN0.60 ptroject)
изображение

изображение
it still happens after I've done react-native link @sentry/react-native
on an Android device this is not present

@HazAT It's working now. Thank you for the awesome support! :)

I double-checked everything.
No logging in release version (issues list is empty)

who faced such problem ?

@webforuse This means either auto linking did not work or react native link. Either way the native component on Android is not running, there must be RNSentry lib in your android project.

Is it possible that you send the source code to me so I can debug what's going on?

In addition, on DEBUG we do not upload sourecemaps to Sentry, the error you get right now is expected.

@HazAT
I saw that not all Android devices triggered sending errors. I tried two. Redmi 6A, didn't want to send. After I wiped it and re-installed the application, everything worked.

source code unfortunately can't give it to a commercial project.

For testing, I created a regular sandbox.
react-native init mysandbox
yarn add @sentry/[email protected]
react-native link @sentry/react-native

configure setup and wizard

after react-native run-ios and get alert

изображение

if i run pod install from ios folder, app its fine start and alert not displayed.
My concern here is how do I then add to an existing project without applying pod install

Also, the source code is not always visible in older versions.

изображение

Thank you for the support!

@webforuse The pod install is only required if you use >= 0.60 the sentry-wizard should patch everything correctly below that version.

@webforuse @HazAT something we noticed on a RN 0.59.9 project was that even though the sentry wizard does things correctly, react-native link @sentry/react-native itself will assume you're adding the module via cocoapods if it finds a Podfile in your projects ios folder, and therefore will not link sentry by modifying the xcode project. So you end up with Sentry not linked at all if you don't install sentry it via cocoapods.
The quick hack was to remove the Podfile and it's lockfile, install + link sentry, and then re-instate the Podfile + Podfile.lock. This allowed use to avoid using cocoapods for sentry, whilst still using it for some other stuff.
Hope that helps!

@HazAT @sandfox many thanks.

But I did not understand why the source files are not displayed
изображение

i force uploaded source-maps from command cli
изображение

But the source code is still not displayed. I don't see what the problem is. Should they update after downloading ? (old or new issues)

@webforuse Are you using beta2?

@HazAT
No. in this case 43.2

@webforuse Can you paste the link to this event here so I can take a look?!

@webforuse Please not the share link, the real one.

@HazAT

@webforuse The version number of the release doesn't match, there is no release called com.ar5-2.0.1 with the dist 47 that is the problem.
Also please, this is the thread for the beta SDK and this event was sent with the previous version.

@HazAT sorry, thanks

@sandfox Yes, thanks this is what happens. The problem is that react-native link add the dependency to the Podfile if it finds one, this is not our Wizard.
So for a project < 0.60 everything should work just fine, but our SDK needs to run the link step in order to setup the Sentry.properties file.
If you run the link it still adds the RNSentry to the Podfile resulting in this warning when trying to run iOS.

➜ react-native run-ios
error React Native CLI uses autolinking for native dependencies, but the following modules are linked manually:
  - @sentry/react-native (to unlink run: "react-native unlink @sentry/react-native")
This is likely happening when upgrading React Native from below 0.60 to 0.60 or above. Going forward, you can unlink this dependency via "react-native unlink <dependency>" and it will be included in your app automatically. If a library isn't compatible with autolinking, disregard this message and notify the library maintainers.
Read more about autolinking: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md

Everything still works, but I am thinking about fixing this in react-native cli since this is probably a "bug" there.

@HazAT PR #615 (looks like an automated one) added the snyk dependency as a non-dev dependency. From what I can tell this probably be moved to a devDependencies as it has no run-time use or otherwise for people consuming this library, and just adds a long tail of dependencies.
Can make a PR if you agree with this?

@sandfox Oh yes, thanks for noticing. That makes sense.

In the transition docs there's no mention of any "native" code changes. Right now we have:

#import <React/RNSentry.h>
...
- (BOOL)application:(UIAppl...
{
  ...
  [RNSentry installWithRootView:rootView];
  ...
}

I assume we can remove that.

@Kikketer Good point, yes this can go.
There are no real transition/migration docs but I will mention this once I write them.
Thanks

Hello, a quick report with a fresh RN 0.60 app, here's what I get when I try to build in release on Android:

Loading dependency graph, done.
info Writing bundle output to:, /Users/louislagrange/Documents/Projets/onepark-app/android/app/build/generated/assets/react/release/index.android.bundle
info Writing sourcemap output to:, /Users/louislagrange/Documents/Projets/onepark-app/android/app/build/intermediates/sourcemaps/release/index.android.bundle.packager.map
info Done writing bundle output
info Done writing sourcemap output
info Copying 9 asset files
info Done copying assets

> Task :app:bundleReleaseJsAndAssets_SentryUpload FAILED
  INFO    2019-07-16 18:37:17.500346 +02:00 Loaded config from /Users/louislagrange/.sentryclirc
  DEBUG   2019-07-16 18:37:17.501981 +02:00 sentry-cli version: 1.46.0, platform: "darwin", architecture: "x86_64"
  INFO    2019-07-16 18:37:17.502029 +02:00 sentry-cli was invoked with the following command line: "/Users/louislagrange/Documents/Projets/onepark-app/node_modules/@sentry/cli/sentry-cli" "react-native" "gradle" "--bundle" "/Users/louislagrange/Documents/Projets/onepark-app/android/app/build/generated/assets/react/release/index.android.bundle" "--sourcemap" "/Users/louislagrange/Documents/Projets/onepark-app/android/app/build/intermediates/sourcemaps/release/index.android.bundle.packager.map" "--release" "fr.onepark.onepark.staging-1.0.0" "--dist" "1000000"
Processing react-native sourcemaps for Sentry upload.
  INFO    2019-07-16 18:37:17.508789 +02:00   bundle path: /Users/louislagrange/Documents/Projets/onepark-app/android/app/build/generated/assets/react/release/index.android.bundle
  INFO    2019-07-16 18:37:17.508845 +02:00   sourcemap path: /Users/louislagrange/Documents/Projets/onepark-app/android/app/build/intermediates/sourcemaps/release/index.android.bundle.packager.map
  DEBUG   2019-07-16 18:37:17.509413 +02:00 Non-file bundle found
> Analyzing 2 sources
  DEBUG   2019-07-16 18:37:17.509867 +02:00 error: running update nagger
  DEBUG   2019-07-16 18:37:17.509904 +02:00 skipping update nagger because session is not attended
error: No such file or directory (os error 2)

Looking at android/app/build/generated/assets/react/release folder, there are two files:

  • index.android.bundle
  • index.android.bundle.map

But there are no file android/app/build/intermediates/sourcemaps/release/index.android.bundle.packager.map

Do you reproduce this?

@Minishlink I wonder where this packager in (bundle.packager.map) is coming from. You are not setting anything by yourself?
How does your build.gradle file look like?
These entries specifically:

project.ext.react = [
    entryFile: "index.js"
]

project.ext.sentryCli = [
    logLevel: "debug"
]

@HazAT Hm, I also have CodePush, maybe a conflict with it?

project.ext.react = [
    entryFile: "index.js",
    enableHermes: false,  // clean and rebuild if changing
]

// no sentrycli options

@Minishlink I can't reproduce this on a clean new 0.60 react native project.
I am not sure where this packager extension is added.

@HazAT Looks like it comes from react-native itself, see here https://github.com/facebook/react-native/blob/v0.60.3/react.gradle#L80

@Minishlink I can repro this with 0.60.3, trying to fix it now. Thanks for the help.

@HazAT if you want to customize autolinking, you can use the new config file FYI: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md#how-can-i-customize-how-autolinking-works-for-my-package

@Minishlink OK, I think this is a bug in react-native itself. I am not quite sure where and how to fix it tho.
I don't understand why this is here? https://github.com/facebook/react-native/blob/v0.60.3/react.gradle#L129
I've created an issue in their repo: https://github.com/facebook/react-native/issues/25693

@Titozzz Thanks for the link I saw this. But I am not sure where this would help.
Our wizard _should_ run to create the properties file we need but patching the Podfile happens in the react native cli directly. I think this needs to be changed in the cli, meaning that if the package, in this case ours @sentry/react-native supports autolinking, it shouldn't add it to the Podfile.

Well you should not run react-native link @sentry/react-native anymore and everything would be fine then!

Regarding the sourcemap issue I'll ping some guys directly as it looks related to another bug I've had with hermes release

@Titozzz OK, so it isn't necessary strictly speaking.
We just have to make our docs clear saying:

If you are using <0.60 do:

react-native link @sentry/react-native

if >=0.60

yarn sentry-wizard -i reactNative -p ios android
cd ios
pod install

I really only wanted to have one way to do this 🤷‍♂

but you can use the custom autolinking, it has hooks to perform this kind of stuff :)

EDIT: NVM these hooks run when using the old command so they are not used anymore

@Titozzz OK, so it isn't necessary strictly speaking.
We just have to make our docs clear saying:

If you are using <0.60 do:

react-native link @sentry/react-native

if >=0.60

yarn sentry-wizard -i reactNative -p ios android
cd ios
pod install

I really only wanted to have one way to do this 🤷‍♂

I think this might be the only viable solution (the cd ios && pod install part has to be done in both scenarios I think)

I think this might be the only viable solution (the cd ios && pod install part has to be done in both scenarios I think)

Fair, but only if you run a Cocoapods setup.

Cocoapods is becoming the new default for react-native, so you can expect more and more users 😄

Thanks @HazAT for handling this 😃

I'm not seeing any breadcrumb information in issues generated through @sentry/[email protected]… neither those that used to be generated automatically by the old SDK (e.g. for console.log calls or fetch requests), nor the entries I am generating "manually" with Sentry.addBreadcrumb.

@yelworc Only on android or also on iOS?

@HazAT I've only been testing it on Android so far.

OK @yelworc , I released 1.0.0-beta.3 which fixes the issue.

@HazAT Works well now with 0.60.4, thanks ;)

@HazAT Does this doc about CodePush need updating? Sentry.setVersion doesn't exist anymore. I see a Sentry.setRelease though, is it the same?

@Minishlink Thanks for pointing this out. Yes, it needs an update but we haven't touched the docs yet since the SDK still is in development.

OK @yelworc , I released 1.0.0-beta.3 which fixes the issue.

Just verified, works fine now! Thanks.
A minor note: In one edge case, I used to supply undefined in the data field (no problem with the old SDK), which now causes this error:

E unknown:ReactNative: Exception in native call
E unknown:ReactNative: java.lang.ClassCastException: Value for data cannot be cast from String to ReadableNativeMap
E unknown:ReactNative:  at com.facebook.react.bridge.ReadableNativeMap.checkInstance(ReadableNativeMap.java:150)
E unknown:ReactNative:  at com.facebook.react.bridge.ReadableNativeMap.getNullableValue(ReadableNativeMap.java:142)
E unknown:ReactNative:  at com.facebook.react.bridge.ReadableNativeMap.getMap(ReadableNativeMap.java:212)
E unknown:ReactNative:  at io.sentry.RNSentryModule.sendEvent(RNSentryModule.java:165)

Using null instead fixed it. I guess that's fine though since your docs do clearly say "A mapping (str => str) of metadata" ☺

Oh, and you might want to update the latest tag on npm, it still points to 1.0.0-beta.0.

Will the docs be updated to reflect these changes soon?

Hey, thanks a lot for providing this little piece of art :))
I have been getting trouble finishing the installation process.

Tested react native 0.60 rc2.
Logs seems to relay a good integration, however the dashboard doesn't report anything.

My dashboard is stuck at "You're almost there! Start capturing errors with just a few lines of code.". Activity tabs contains "Nothing to show here, move along.". I am probably missing some point here. Do I need to register an event or is integration enough ? I can't access to the doc to register a new event as the app dashboard onboarding process seems to be stuck at installation phase.

I am also wondering if error reporting works with background android service when the app isn't open.

package json:

    "react-native": "0.60.0-rc.2",
    "@sentry/react-native": "1.0.0-beta.3",

Logs:

roidSentryClientFactory  D  Construction of Android Sentry.
roidSentryClientFactory  D  Sentry init with ctx='org.pnplab.flux.MainApplication@2db921e'
roidSentryClientFactory  D  Using buffer dir: /data/user/0/org.pnplab.flux/cache/sentry-buffered-events
          ReactNativeJS  I  Running application "Flux" with appParams: {"rootTag":21}. __DEV__ === true, development-level warning are ON, performance optimizations are OFF
    react-native-sentry  I  startWithDsnString 'https://[email protected]/1509749'

Will the docs be updated to reflect these changes soon?

@karltaylor Once we say it's ready for prime time, so far the docs for this is the first comment.

@nuKs This looks good so far, did you try to call Sentry.captureMessage and see if the event pops up?

[RNSentry installWithRootView:rootView];

@HazAT About this. Is there a supported way to manually install sentry native client in appDidFinishLaunching or earlier (and i guess the same for android but I'm not the expert)? I'm concerned about crashes (native or otherwise) just going missing if it happens before JS bundle gets loaded and Sentry.init() is called.

Thanks for all the hard work! Super excited to see the RN SDK get unified!

I stumbled upon the same issue as @yelworc in https://github.com/getsentry/sentry-react-native/issues/612#issuecomment-513158263. The line differs slightly but I suspect it's otherwise identical.

Version: @sentry/[email protected]

Click for stack trace

com.facebook.react.bridge.UnexpectedNativeTypeException: Value for data cannot be cast from String to ReadableNativeMap
        at com.facebook.react.bridge.ReadableNativeMap.checkInstance(ReadableNativeMap.java:141)
        at com.facebook.react.bridge.ReadableNativeMap.getNullableValue(ReadableNativeMap.java:129)
        at com.facebook.react.bridge.ReadableNativeMap.getMap(ReadableNativeMap.java:173)
        at io.sentry.RNSentryModule.sendEvent(RNSentryModule.java:165)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
        at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:158)
        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
        at android.os.Handler.handleCallback(Handler.java:873)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
        at android.os.Looper.loop(Looper.java:193)
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:232)
        at java.lang.Thread.run(Thread.java:764)

This occurs while using https://github.com/vidit-sh/redux-sentry-middleware (~haven't yet tried any serious debugging~). I know this SDK is still beta and redux-sentry-middleware might be targeting the @sentry/browser package. However, it would be great to be able to use such packages seamlessly with any flavor of the _unified_ API (@sentry/{node|web|react-native)).

As an end user I'd love to see this handled gracefully, by e.g. accepting the payload and rendering a warning on Sentry's Issue details (as currently happens in some cases). Or at the very least to log a warning (with debug: true) without crashing the app.

As a side note, I'm using Hermes and thus far haven't found any issues with compatibility. I'll do some more tests on the upcoming days and let you know if something breaks.

EDIT:

I found the culprit: the data key for breadcrumb payload was supplied an undefined which got turned into a "undefined" string. However the RN native bridge was expecting a map. The workaround was to supply an empty object.

However, the data type in https://github.com/getsentry/sentry-javascript/blob/master/packages/types/src/breadcrumb.ts#L10 is any which is misleading.

Hi! :) Thanks for working on that one, it's great! However, I'm getting some issue with release build on iOS. Right in startWithDsnString method. I'm not sure if I missed something in upgrade. Here's log from local crash as it does not send it to Sentry because of error in init.

Sentry: 1.0.0-beta.3
React-Native: 0.60.4
XCode: 10.2.1

```
Application Specific Information:
* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]'
terminating with uncaught exception of type NSException
abort() called
CoreSimulator 675 - Device: iPhone SE (EDA299E1-6174-458D-9A9A-D363FF12757E) - Runtime: iOS 12.2 (16E226) - DeviceType: iPhone SE
†'3

Application Specific Backtrace 1:
0 CoreFoundation 0x00000001080876fb __exceptionPreprocess + 331
1 libobjc.A.dylib 0x0000000106ed8ac5 objc_exception_throw + 48
2 CoreFoundation 0x0000000107fd5ddc _CFThrowFormattedException + 194
3 CoreFoundation 0x00000001080f3c31 -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 321
4 CoreFoundation 0x00000001080833db +[NSDictionary dictionaryWithObjects:forKeys:count:] + 59
5 0x0000000101c2cc6a -[SentryClient initWithDsn:didFailWithError:] + 112
6 0x0000000101b4e7b5 -[RNSentry startWithDsnString:options:resolve:rejecter:] + 132
7 CoreFoundation 0x000000010808e4cc __invoking___ + 140
8 CoreFoundation 0x000000010808ba45 -[NSInvocation invoke] + 325
9 CoreFoundation 0x000000010808be96 -[NSInvocation invokeWithTarget:] + 54
10 0x0000000101b89c9a -[RCTModuleMethod invokeWithBridge:module:arguments:] + 602
11 0x0000000101b8c0ed _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 251
12 0x0000000101b8be6f ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 78
13 libdispatch.dylib 0x000000010a339ccf _dispatch_call_block_and_release + 12
14 libdispatch.dylib 0x000000010a33ad02 _dispatch_client_callout + 8
15 libdispatch.dylib 0x000000010a346a50 _dispatch_main_queue_callback_4CF + 1276
16 CoreFoundation 0x0000000107fee8a9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
17 CoreFoundation 0x0000000107fe8f56 __CFRunLoopRun + 2310
18 CoreFoundation 0x0000000107fe8302 CFRunLoopRunSpecific + 626
19 Foundation 0x00000001037bb044 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 277
20 Foundation 0x00000001037bb246 -[NSRunLoop(NSRunLoop) runUntilDate:] + 79
21 0x0000000101d2b532 +[RNSplashScreen show] + 242
22 0x0000000101973a5b -[AppDelegate application:didFinishLaunchingWithOptions:] + 699
23 UIKitCore 0x0000000112398311 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 280
24 UIKitCore 0x0000000112399cad -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 3932
25 UIKitCore 0x000000011239f0c6 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1617
26 UIKitCore 0x0000000111be46d6 __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 904
27 UIKitCore 0x0000000111becfce +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 153
28 UIKitCore 0x0000000111be42ec -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 236
29 UIKitCore 0x0000000111be4c48 -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 1091
30 UIKitCore 0x0000000111be2fba __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 782
31 UIKitCore 0x0000000111be2c71 -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 433
32 UIKitCore 0x0000000111be79b6 __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 576
33 UIKitCore 0x0000000111be8610 _performActionsWithDelayForTransitionContext + 100
34 UIKitCore 0x0000000111be771d -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 223
35 UIKitCore 0x0000000111bec6d0 -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 392
36 UIKitCore 0x000000011239d9a8 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 514
37 UIKitCore 0x0000000111f54dfa -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 361
38 FrontBoardServices 0x000000010fcdb125 -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 448
39 FrontBoardServices 0x000000010fce4ed6 __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 283
40 FrontBoardServices 0x000000010fce4700 __40-[FBSWorkspace _performDelegateCallOut:]_block_invoke + 53
41 libdispatch.dylib 0x000000010a33ad02 _dispatch_client_callout + 8
42 libdispatch.dylib 0x000000010a33dd41 _dispatch_block_invoke_direct + 295
43 FrontBoardServices 0x000000010fd16146 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 30
44 FrontBoardServices 0x000000010fd15dfe -[FBSSerialQueue _performNext] + 451
45 FrontBoardServices 0x000000010fd16393 -[FBSSerialQueue _performNextFromRunLoopSource] + 42
46 CoreFoundation 0x0000000107feebe1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
47 CoreFoundation 0x0000000107fee463 __CFRunLoopDoSources0 + 243
48 CoreFoundation 0x0000000107fe8b1f __CFRunLoopRun + 1231
49 CoreFoundation 0x0000000107fe8302 CFRunLoopRunSpecific + 626
50 GraphicsServices 0x000000010e9d52fe GSEventRunModal + 65
51 UIKitCore 0x00000001123a0ba2 UIApplicationMain + 140
52 0x0000000101973f35 main + 80
53 libdyld.dylib 0x000000010a3a8541 start + 1
54 ??? 0x0000000000000001 0x0 + 1
````

@dsznajder You probably didn't update the initialization code properly. But it would be good to catch this error (invalid DSN) in JS code, instead of getting a weird failure on the bridge. you should contribute ;)

@radex Thanks for response. I would definitely contribute if I know any on Obj-C :D

BTW. when it comes to initialization code: I've followed first comment as it says that Initialization should be removed from AppDelegate.m . yarn sentry-wizard did not add anything new to it.

EDIT:

Ok, I'm dumb. My env wasn't properly passed :) Thanks for tip (invalid DSN). I will try to do something about this error but does not feel like I'm going to make it right :D

I'm trying to set this up in a Typescript project but I'm getting a type error with the Sentry.init function:

src/frontend/frontend_config/overrides/index.mobile.ts:17:15 - error TS2345: Argument of type '{ dsn: string; }' is not assignable to parameter of type 'ReactNativeOptions'.
  Type '{ dsn: string; }' is missing the following properties from type 'ReactNativeOptions': enableNative, enableNativeCrashHandling

17   Sentry.init({
                 ~
18     dsn: cfg.BAGEL_SENTRY_DSN
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19   })
   ~~~

I'm on version 1.0.0-beta.3.

Hello,

I found out native crash aren't recorded, even after app relaunch and wait, both release (at least if crash occurs on background service) and debug.

// --- log true
Sentry.captureMessage(`isNativeClientAvailable: ${RNSentry.nativeClientAvailable}`);
setTimeout(() => {
    // ---- display error but nothing is captured
    RNSentry.crash();
}, 5000);
    "react-native": "0.60.0-rc.2",
    "@sentry/react-native": "1.0.0-beta.3",

-- Regards

Any timeline given for Hermes support? :)

@christhegrand 1.0.0-beta.4 is released fixing this.

@nuKs 1.0.0-beta.4 now has Sentry.nativeCrash() exposed correctly, I tried it on both iOS and Android and it works as expected. (Make sure you run in release and have no debugger attached)

@N1ghtly Hehe, so generally it works, the major problem is their bundle format is completely different and not documented. We just recently added support for RAM bundles where the specs and docs are also pretty sparse. We need to be able to parse the bundle and source maps to have correct support for JS stack traces. ref: https://github.com/facebook/hermes/issues/51

Thanks for the quick reply!

@HazAT Here's a release for an app using hermes if that can help https://sentry.io/organizations/th3rdwave/releases/com.th3rdwave-5.1.0/artifacts/?project=167056. Looks like the artifacts are uploaded properly but symbolication fails.

Let me know if you need help reaching out to someone on the Hermes team to figure out how to make it work.

@janicduplessis Thanks!
So just to give you an idea of what we do with RAM bundles.
We break them up locally on the users machine with sentry-cli and upload all sources + source maps of every module to Sentry so we can symbolicate the stack trace.

The problem with Hermes right now is, that the spec of the bundle is not documented anywhere and also it seems that the stack trace that gets reported neither has a module or any JS in there.

image

It would be great to get any feedback/support on how to debug hermes bundles, so far it looks like a black box with no intention of being debugged and therefore our strategy is to wait 🤷‍♂

I continue to have the error:

[DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: STARTING
[DEBUG] [org.gradle.process.internal.DefaultExecHandle] Waiting until process started: command 'node_modules/@sentry/cli/bin/sentry-cli'.
[DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: STARTED
[DEBUG] [org.gradle.process.internal.ExecHandleRunner] waiting until streams are handled...
[INFO] [org.gradle.process.internal.DefaultExecHandle] Successfully started process 'command 'node_modules/@sentry/cli/bin/sentry-cli''
[QUIET] [system.out] Processing react-native sourcemaps for Sentry upload.
[ERROR] [system.err] error: No such file or directory (os error 2)
[QUIET] [system.out] > Analyzing 2 sources
[ERROR] [system.err] 
[ERROR] [system.err] Add --log-level=[info|debug] or export SENTRY_LOG_LEVEL=[info|debug] to see more output.
[ERROR] [system.err] Please attach the full debug log to all bug reports.
[DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: FAILED
[DEBUG] [org.gradle.process.internal.DefaultExecHandle] Process 'command 'node_modules/@sentry/cli/bin/sentry-cli'' finished with exit value 1 (state: FAILED)
[DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Execute exec for :app:bundleReleaseJsAndAssets_SentryUpload'
[DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Execute exec for :app:bundleReleaseJsAndAssets_SentryUpload' completed
[DEBUG] [org.gradle.internal.execution.impl.steps.CacheStep] Not storing result of task ':app:bundleReleaseJsAndAssets_SentryUpload' in cache because the execution failed
[DEBUG] [org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter] Removed task artifact state for {} from context.
[DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Task :app:bundleReleaseJsAndAssets_SentryUpload'
[DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Task :app:bundleReleaseJsAndAssets_SentryUpload' completed
[INFO] [org.gradle.execution.plan.DefaultPlanExecutor] :app:bundleReleaseJsAndAssets_SentryUpload (Thread[Execution worker for ':' Thread 5,5,main]) completed. Took 0.097 secs.
[DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker for ':' Thread 5: released lock on :
[DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Worker lease root.1.103 completed (1 worker(s) in use)
[DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker for ':' Thread 5: released lock on root.1.103
[DEBUG] [org.gradle.execution.plan.DefaultPlanExecutor] Execution worker [Thread[Execution worker for ':' Thread 5,5,main]] finished, busy: 1.5 secs, idle: 0.919 secs
[DEBUG] [org.gradle.execution.plan.DefaultPlanExecutor] Execution worker [Thread[Daemon worker Thread 10,5,main]] finished, busy: 0.591 secs, idle: 1.828 secs
[DEBUG] [org.gradle.execution.plan.DefaultPlanExecutor] Execution worker [Thread[Execution worker for ':' Thread 2,5,main]] finished, busy: 0.353 secs, idle: 2.067 secs
[DEBUG] [org.gradle.execution.plan.DefaultPlanExecutor] Execution worker [Thread[Execution worker for ':' Thread 6,5,main]] finished, busy: 0.314 secs, idle: 2.105 secs
[DEBUG] [org.gradle.execution.plan.DefaultPlanExecutor] Execution worker [Thread[Execution worker for ':' Thread 3,5,main]] finished, busy: 0.503 secs, idle: 1.917 secs
[DEBUG] [org.gradle.execution.plan.DefaultPlanExecutor] Execution worker [Thread[Execution worker for ':' Thread 4,5,main]] finished, busy: 0.361 secs, idle: 2.059 secs
[DEBUG] [org.gradle.execution.plan.DefaultPlanExecutor] Execution worker [Thread[Execution worker for ':',5,main]] finished, busy: 0.339 secs, idle: 2.081 secs
[DEBUG] [org.gradle.execution.plan.DefaultPlanExecutor] Execution worker [Thread[Execution worker for ':' Thread 7,5,main]] finished, busy: 0.405 secs, idle: 2.014 secs
[DEBUG] [org.gradle.execution.taskgraph.DefaultTaskExecutionGraph] Timing: Executing the DAG took 2.422 secs
[DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Run tasks'
[DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Run tasks' completed
[DEBUG] [org.jetbrains.kotlin.gradle.plugin.KotlinGradleBuildServices] [KOTLIN] Disposed KotlinGradleBuildServices
[DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Worker lease root.1 completed (0 worker(s) in use)
[DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Daemon worker Thread 10: released lock on root.1
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':app:bundleReleaseJsAndAssets_SentryUpload'.
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Process 'command 'node_modules/@sentry/cli/bin/sentry-cli'' finished with non-zero exit value 1
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run with --stacktrace option to get the stack trace.  Run with --scan to get full insights.
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Get more help at https://help.gradle.org
[WARN] [org.gradle.internal.featurelifecycle.LoggingDeprecatedFeatureHandler] 
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings
[ERROR] [org.gradle.internal.buildevents.BuildResultLogger] 
[ERROR] [org.gradle.internal.buildevents.BuildResultLogger] BUILD FAILED in 10s

@Genitivo Can you add this to your gradle file

project.ext.sentryCli = [
    logLevel: "debug"
]

And post the output again please.

[LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] > Task :app:bundleReleaseJsAndAssets
[QUIET] [system.out] info Copying 56 asset files
[QUIET] [system.out] info Done copying assets
[DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: SUCCEEDED
[DEBUG] [org.gradle.process.internal.DefaultExecHandle] Process 'command 'node'' finished with exit value 0 (state: SUCCEEDED)
[DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Execute exec for :app:bundleReleaseJsAndAssets'
[DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Execute exec for :app:bundleReleaseJsAndAssets' completed
[DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Execute doLast {} action for :app:bundleReleaseJsAndAssets' started
[DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] parsing buildfile jar:file:/Users/Michele/.gradle/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/lib/ant-1.9.13.jar!/org/apache/tools/ant/antlib.xml with URI = jar:file:/Users/Michele/.gradle/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/lib/ant-1.9.13.jar!/org/apache/tools/ant/antlib.xml from a zip file
[INFO] [org.gradle.api.internal.project.ant.AntLoggingAdapter] [ant:move] Moving 1 file to /Users/Michele/Documents/Wanderio/app-android/android/app/build/generated/assets/react/release
[DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] [ant:move] Attempting to rename: /Users/Michele/Documents/Wanderio/app-android/android/app/build/intermediates/sourcemaps/release/index.android.bundle.packager.map to /Users/Michele/Documents/Wanderio/app-android/android/app/build/generated/assets/react/release/index.android.bundle.map
[DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Execute doLast {} action for :app:bundleReleaseJsAndAssets'
[DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Execute doLast {} action for :app:bundleReleaseJsAndAssets' completed
[DEBUG] [org.gradle.api.internal.changedetection.changes.TaskFingerprintUtil] Fingerprinting property $1 (Output) for task ':app:bundleReleaseJsAndAssets'
[DEBUG] [org.gradle.api.internal.changedetection.changes.TaskFingerprintUtil] Fingerprinting property $2 (Output) for task ':app:bundleReleaseJsAndAssets'
[DEBUG] [org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter] Removed task artifact state for {} from context.
[DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Task :app:bundleReleaseJsAndAssets'
[DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Task :app:bundleReleaseJsAndAssets' completed
[INFO] [org.gradle.execution.plan.DefaultPlanExecutor] :app:bundleReleaseJsAndAssets (Thread[Execution worker for ':' Thread 5,5,main]) completed. Took 1 mins 32.458 secs.
[DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker for ':' Thread 5: released lock on :
[DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Worker lease root.1.103 completed (1 worker(s) in use)
[DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker for ':' Thread 5: released lock on root.1.103
[DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker for ':' Thread 5: acquired lock on :
[DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Worker lease root.1.103 started (1 worker(s) in use).
[DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker for ':' Thread 5: acquired lock on root.1.103
[INFO] [org.gradle.execution.plan.DefaultPlanExecutor] :app:bundleReleaseJsAndAssets_SentryUpload (Thread[Execution worker for ':' Thread 5,5,main]) started.
[LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] 
[LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] > Task :app:bundleReleaseJsAndAssets_SentryUpload FAILED
[DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Task :app:bundleReleaseJsAndAssets_SentryUpload' started
[DEBUG] [org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter] Putting task artifact state for task ':app:bundleReleaseJsAndAssets_SentryUpload' into context took 0.0 secs.
[DEBUG] [org.gradle.internal.execution.impl.steps.SkipUpToDateStep] Determining if task ':app:bundleReleaseJsAndAssets_SentryUpload' is up-to-date
[INFO] [org.gradle.internal.execution.impl.steps.SkipUpToDateStep] Task ':app:bundleReleaseJsAndAssets_SentryUpload' is not up-to-date because:
  Task has not declared any outputs despite executing actions.
[DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter] Executing actions for task ':app:bundleReleaseJsAndAssets_SentryUpload'.
[DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Execute exec for :app:bundleReleaseJsAndAssets_SentryUpload' started
[INFO] [org.gradle.process.internal.DefaultExecHandle] Starting process 'command 'node_modules/@sentry/cli/bin/sentry-cli''. Working directory: /Users/Michele/Documents/Wanderio/app-android Command: node_modules/@sentry/cli/bin/sentry-cli react-native gradle --bundle /Users/Michele/Documents/Wanderio/app-android/android/app/build/generated/assets/react/release/index.android.bundle --sourcemap /Users/Michele/Documents/Wanderio/app-android/android/app/build/intermediates/sourcemaps/release/index.android.bundle.packager.map --release com.wanderio-1.9.7 --dist 61
[DEBUG] [org.gradle.process.internal.DefaultExecHandle] Environment for process 'command 'node_modules/@sentry/cli/bin/sentry-cli'': {IRBRC=/Users/Michele/.rvm/rubies/ruby-2.3.0/.irbrc, PATH=//anaconda/bin:/Users/Michele/.rvm/gems/ruby-2.3.0/bin:/Users/Michele/.rvm/gems/ruby-2.3.0@global/bin:/Users/Michele/.rvm/rubies/ruby-2.3.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/Michele/.rvm/bin:/usr/local/var/lib/android-sdk/tools:/usr/local/var/lib/android-sdk/platform-tools, JAVA_MAIN_CLASS_65645=org.gradle.wrapper.GradleWrapperMain, _system_arch=x86_64, rvm_bin_path=/Users/Michele/.rvm/bin, SENTRY_PROPERTIES=/Users/Michele/Documents/Wanderio/app-android/android/sentry.properties, JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home, TERM=xterm-256color, rvm_prefix=/Users/Michele, ANDROID_HOME=/usr/local/var/lib/android-sdk, DISPLAY=/private/tmp/com.apple.launchd.yQWSj5uhAv/org.macosforge.xquartz:0, LOGNAME=Michele, rvm_version=1.29.1 (latest), TERM_PROGRAM_VERSION=421.2, PWD=/Users/Michele/Documents/Wanderio/app-android/android, XPC_SERVICE_NAME=0, APP_ICON_65645=/Users/Michele/Documents/Wanderio/app-android/android/media/gradle.icns, Path=/Users/Michele/Documents/Roma3/hadoop-2.8.0/bin://anaconda/bin:/Users/Michele/.rvm/gems/ruby-2.3.0/bin:/Users/Michele/.rvm/gems/ruby-2.3.0@global/bin:/Users/Michele/.rvm/rubies/ruby-2.3.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/Michele/.rvm/bin, NVM_CD_FLAGS=, SHELL=/bin/bash, NVM_DIR=/Users/Michele/.nvm, TERM_PROGRAM=Apple_Terminal, _system_type=Darwin, MY_RUBY_HOME=/Users/Michele/.rvm/rubies/ruby-2.3.0, HIVE_HOME=/Users/Michele/Documents/Roma3/apache-hive-2.1.1, OLDPWD=/Users/Michele/Documents/Wanderio/app-android/android, _system_version=10.14, SECURITYSESSIONID=186db, GEM_HOME=/Users/Michele/.rvm/gems/ruby-2.3.0, USER=Michele, TMPDIR=/var/folders/yq/86_8gw3j4z7dq6wm8sn0_ld00000gn/T/, rvm_path=/Users/Michele/.rvm, SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.RFc8c86J1l/Listeners, XPC_FLAGS=0x0, GEM_PATH=/Users/Michele/.rvm/gems/ruby-2.3.0:/Users/Michele/.rvm/gems/ruby-2.3.0@global, RUBY_VERSION=ruby-2.3.0, TERM_SESSION_ID=13BA589D-539A-4462-AEB6-23B17B5C4A1A, _system_name=OSX, HADOOP_HOME=/Users/Michele/Documents/Roma3/hadoop-2.8.0, __CF_USER_TEXT_ENCODING=0x1F5:0x0:0x4, Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.Tdp8G1YQXo/Render, APP_NAME_65645=Gradle, LC_CTYPE=UTF-8, LOCATE_PATH=~/tmp/locatedb, SHLVL=1, HOME=/Users/Michele}
[DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: STARTING
[DEBUG] [org.gradle.process.internal.DefaultExecHandle] Waiting until process started: command 'node_modules/@sentry/cli/bin/sentry-cli'.
[DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: STARTED
[INFO] [org.gradle.process.internal.DefaultExecHandle] Successfully started process 'command 'node_modules/@sentry/cli/bin/sentry-cli''
[DEBUG] [org.gradle.process.internal.ExecHandleRunner] waiting until streams are handled...
[QUIET] [system.out] Processing react-native sourcemaps for Sentry upload.
[ERROR] [system.err] error: No such file or directory (os error 2)
[ERROR] [system.err] 
[QUIET] [system.out] > Analyzing 2 sources
[ERROR] [system.err] Add --log-level=[info|debug] or export SENTRY_LOG_LEVEL=[info|debug] to see more output.
[ERROR] [system.err] Please attach the full debug log to all bug reports.
[DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: FAILED
[DEBUG] [org.gradle.process.internal.DefaultExecHandle] Process 'command 'node_modules/@sentry/cli/bin/sentry-cli'' finished with exit value 1 (state: FAILED)
[DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Execute exec for :app:bundleReleaseJsAndAssets_SentryUpload'
[DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Execute exec for :app:bundleReleaseJsAndAssets_SentryUpload' completed
[DEBUG] [org.gradle.internal.execution.impl.steps.CacheStep] Not storing result of task ':app:bundleReleaseJsAndAssets_SentryUpload' in cache because the execution failed
[DEBUG] [org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter] Removed task artifact state for {} from context.
[DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Task :app:bundleReleaseJsAndAssets_SentryUpload'
[DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Task :app:bundleReleaseJsAndAssets_SentryUpload' completed
[INFO] [org.gradle.execution.plan.DefaultPlanExecutor] :app:bundleReleaseJsAndAssets_SentryUpload (Thread[Execution worker for ':' Thread 5,5,main]) completed. Took 0.144 secs.
[DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker for ':' Thread 5: released lock on :
[DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Worker lease root.1.103 completed (1 worker(s) in use)
[DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker for ':' Thread 5: released lock on root.1.103
[DEBUG] [org.gradle.execution.plan.DefaultPlanExecutor] Execution worker [Thread[Execution worker for ':' Thread 5,5,main]] finished, busy: 1 mins 33.531 secs, idle: 4.551 secs
[DEBUG] [org.gradle.execution.plan.DefaultPlanExecutor] Execution worker [Thread[Execution worker for ':' Thread 2,5,main]] finished, busy: 0.329 secs, idle: 1 mins 37.755 secs
[DEBUG] [org.gradle.execution.plan.DefaultPlanExecutor] Execution worker [Thread[Execution worker for ':' Thread 3,5,main]] finished, busy: 0.418 secs, idle: 1 mins 37.666 secs
[DEBUG] [org.gradle.execution.plan.DefaultPlanExecutor] Execution worker [Thread[Execution worker for ':' Thread 7,5,main]] finished, busy: 0.351 secs, idle: 1 mins 37.73 secs
[DEBUG] [org.gradle.execution.plan.DefaultPlanExecutor] Execution worker [Thread[Daemon worker Thread 7,5,main]] finished, busy: 0.337 secs, idle: 1 mins 37.745 secs
[DEBUG] [org.gradle.execution.plan.DefaultPlanExecutor] Execution worker [Thread[Execution worker for ':',5,main]] finished, busy: 2.094 secs, idle: 1 mins 35.991 secs
[DEBUG] [org.gradle.execution.plan.DefaultPlanExecutor] Execution worker [Thread[Execution worker for ':' Thread 6,5,main]] finished, busy: 1.791 secs, idle: 1 mins 36.291 secs
[DEBUG] [org.gradle.execution.plan.DefaultPlanExecutor] Execution worker [Thread[Execution worker for ':' Thread 4,5,main]] finished, busy: 1.06 secs, idle: 1 mins 37.024 secs
[DEBUG] [org.gradle.execution.taskgraph.DefaultTaskExecutionGraph] Timing: Executing the DAG took 1 mins 38.089 secs
[DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Run tasks'
[DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Run tasks' completed
[INFO] [org.gradle.api.Task] AAPT2 aapt2-3.4.1-5326820-osx Daemon #0: shutdown
[DEBUG] [org.jetbrains.kotlin.gradle.plugin.KotlinGradleBuildServices] [KOTLIN] Disposed KotlinGradleBuildServices
[DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Worker lease root.1 completed (0 worker(s) in use)
[DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Daemon worker Thread 7: released lock on root.1
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':app:bundleReleaseJsAndAssets_SentryUpload'.
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Process 'command 'node_modules/@sentry/cli/bin/sentry-cli'' finished with non-zero exit value 1
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run with --stacktrace option to get the stack trace.  Run with --scan to get full insights.
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Get more help at https://help.gradle.org
[WARN] [org.gradle.internal.featurelifecycle.LoggingDeprecatedFeatureHandler] 
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings
[ERROR] [org.gradle.internal.buildevents.BuildResultLogger] 
[ERROR] [org.gradle.internal.buildevents.BuildResultLogger] BUILD FAILED in 1m 46s

Apparently if I abilitate Hermes in the project.ext.react, every things works fine.

@Genitivo Which version of react-native are you using?
Also, I don't see the debug output of Sentry CLI, did you put it before sentry.gradle?

@HazAT Hey, could I get an answer to this question: https://github.com/getsentry/sentry-react-native/issues/612#issuecomment-513817612 ? I'm OK with digging in native code if needed

@radex You should be able to just import

#import <Sentry/Sentry.h>

And follow the docs here:
https://docs.sentry.io/clients/cocoa/#configure

SentryClient *client = [[SentryClient alloc] initWithDsn:@"DSN" didFailWithError:&error];
SentryClient.sharedClient = client;
[SentryClient.sharedClient startCrashHandlerWithError:&error];

@HazAT
React-native: 0.60.3
Sentry: 1.0.0-beta.4

Sorry I put it after sentry command. Here the output:

> Task :app:bundleReleaseJsAndAssets_SentryUpload FAILED
  INFO    2019-07-30 10:58:59.038668 +02:00 Loaded config from /Users/Michele/.sentryclirc
  DEBUG   2019-07-30 10:58:59.039943 +02:00 sentry-cli version: 1.47.0, platform: "darwin", architecture: "x86_64"
  INFO    2019-07-30 10:58:59.040004 +02:00 sentry-cli was invoked with the following command line: "/Users/Michele/Documents/Wanderio/app-android/node_modules/@sentry/cli/sentry-cli" "--log-level" "debug" "react-native" "gradle" "--bundle" "/Users/Michele/Documents/Wanderio/app-android/android/app/build/generated/assets/react/release/index.android.bundle" "--sourcemap" "/Users/Michele/Documents/Wanderio/app-android/android/app/build/intermediates/sourcemaps/release/index.android.bundle.packager.map" "--release" "com.wanderio-1.9.7" "--dist" "61"
Processing react-native sourcemaps for Sentry upload.
  INFO    2019-07-30 10:58:59.045779 +02:00   bundle path: /Users/Michele/Documents/Wanderio/app-android/android/app/build/generated/assets/react/release/index.android.bundle
  INFO    2019-07-30 10:58:59.045811 +02:00   sourcemap path: /Users/Michele/Documents/Wanderio/app-android/android/app/build/intermediates/sourcemaps/release/index.android.bundle.packager.map
  DEBUG   2019-07-30 10:58:59.046408 +02:00 Non-file bundle found
> Analyzing 2 sources
  DEBUG   2019-07-30 10:58:59.047522 +02:00 error: running update nagger
  DEBUG   2019-07-30 10:58:59.047553 +02:00 skipping update nagger because session is not attended
error: No such file or directory (os error 2)
  DEBUG   2019-07-30 10:58:59.049194 +02:00 client close; no transport to shut down  (from sentry)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets_SentryUpload'.
> Process 'command 'node_modules/@sentry/cli/bin/sentry-cli'' finished with non-zero exit value 1

I had react-native 0.60.3 installed and was failing the Android assembleRelease build with sentry could not find sourcemaps but then updated to react-native 0.60.4 and it works with "@sentry/react-native": "^1.0.0-beta.4" 🤘

@crobinson42 and @Genitivo I am struggling with the same problem you seem to have. I just updated to react-native .60.4 and the error is gone! However it does not look right to me. I have not used sentry before but it does not look like the sourcemaps are being used in the error report? I called an undefined function from a component file, but the stack trace in this screenshot is all from the index.bundle? Is that not right?

image

We just wanted to integrate the sentry beta into our yarn workspaces setup. Unfortunately we can't get it running because of the new folder structure of sentry. We have the following default nohoist configuration:

"nohoist": [
      "**/react-native",
      "**/react-native/**"
    ]

Because of the folder structure "@sentry/react-native" the nohoist configuration also matches the senty subfolder. Stupidly the nohoist configuration doesn't accept regex or at least multiple folders in the nohoist configuration like "**/node_modules/react-native/**". Therefore we have currently no chance of using the beta in our setup.

@NickAVolpe This is in debug, I will check if it's possible to symbolicate the stacktrace on the device in debug builds.

@saschak42 This is too bad, why can't you be more specific like "nohoist": ["A/react-native", "A/react-native/**"] ?

@NickAVolpe This is in debug, I will check if it's possible to symbolicate the stacktrace on the device in debug builds.

Just tested release, it works! You rock @HazAT

@HazAT I tried it, but yarn doesn't allow this form of exclusion (see https://github.com/yarnpkg/yarn/issues/6412). Because we have a large RN setup with multiple teams and a ton of libs, the configuration would be big and not easy to maintain. Is there any chance of renaming the subfolder "react-native" to something like "xxx-react-native" or something without the exact wording "react-native"?

@NickAVolpe I quickly implemented on the device symbolication for debug builds 😅
It's there in 1.0.0-beta.5

We now have an integration that runs only in debug doing symbolication on the device. Providing a better stack trace for debug builds with correct line numbers and filenames for application frames.

Before
before

After
after

@saschak42 We have support from @BYK 🎉
Let's see if we can figure this out.

Hey, I've been working on source maps and symbolication from the React Native / Metro / Hermes side of things. Is there anything in particular I can help with here?

@motiz88 I don't know. I think there are 2 possible solutions for the nohoist problem.

  1. Renaming the folder of the Sentry module to something different.
  2. Fixing/Extending the nohoisting options, so that we can use a regex or at least a exclution path with more than one part ("**/node_modules/react-native/**" instead of "**/react-native/**")

But if you have a better idea, that would be great :)

Sorry, @saschak42, I don't have context on how the Sentry integration is built and I don't work on Yarn. Hopefully between this issue and https://github.com/yarnpkg/yarn/issues/6412 there will be some progress on that?

If anyone has specific issues or questions related to source maps and symbolication with recent React Native releases (and Hermes), please do let me know.

@motiz88 We have @BYK working on the yarn issue, so we should be covered.

But we would need support with Hermes, specifically when it comes to symbolication of crashes. (Symbolication for normal bundles and RAM bundles are already covered)
I've already asked a question in the Hermes repo https://github.com/facebook/hermes/issues/51
but the answer seems like "We should wait".

Anyway, if you have more insight let me know, you can also shoot me an email [email protected] any help is appreciated, Thank you!

Just to be clear, while with this version of RNSentry I can remove the code that I had in AppDelegate.m, I need to keep the Sentry-related code that's in MainApplication.java, right?

@christhegrand I think this can also be safely removed

@saschak42 - I'm planning to look into the nohoist issue in yarn soon but I'm guessing it won't be soon enough for you as this seems pretty urgent on your end. Would this help you in the meantime: https://til.hashrocket.com/posts/oxmc7kencg-alias-an-npm-package-with-yarn-add

This way, you should be able to rename the @sentry/react-native to something else but it should still work.

@HazAT I'm getting an issue on iOS crashes where the "Source code was not found" while processing the event. The bundle and source map appear to be uploaded correctly, but the Url path to the source seems to be wrong: /var/containers/Bundle/Application/D31A5707-DDCA-4A0C-8CD7-52C6AA10E84E/[Appname].app/main.jsbundle

Before, the path used to be stripped so it was only looking for /main.jsbundle, but now it looks like the local path with UUID is part of the Url? I could be missing something obvious here, but it's strange since Android crashes are processed correctly with the source map + source.

Thanks for all your work on this!

@BYK Thanks, your suggested workaround works! :)

@HazAT We have still one last problem, because we use an Android buildscript which generates aar-files from our RN dependencies. We need this, because the IDE would be completely overloaded with the many dependencies we use. We tried it, but Android Studio often behaved odd and we needed to restart it a few times a day...

Now our script fails, because the Sentry build.gradle file is incomplete. I don't know how this can even work, but we have seen this also in a few other RN libraries. Maybe you can explain that to me. I've looked at this and got it to work. I've added the missing repositories and also the Android Gradle plugin:

buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.2'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven {
            url "$rootDir/../../../react-native/android"
        }
    }
}

I also needed to update the compileSdkVersion and the targetSdkVersion to 28 and change the sentry-android import from implementation to api. Have you any ideas on this?

Can integrations be used with React Native now?

Guys, on Android is throwing:
Warning, could not cnonect to Sentry native SDK. Did you forget to run react-native link @sentry/react-native?

But i ran that already, it's supposed to be linked, any idea of why this is still being thrown?

When building on ios with react native 0.60.4 and beta.7 , I get this

Screenshot 2019-08-04 at 16 12 12

Any idea ?

We've just implemented the beta SDK, but we hadn't installed the stable beta before. The crashes appear correctly within Sentry, but we have two questions about the mappings/sourcemaps/dSYM uploads:

  1. The sentry-android-gradle-plugin uploads the Android mappings file correctly and the desymbolication works, but we can't see it under the artifacts tab of the release. Is this the expected behaviour? If so, where can we find the uploaded mappings file?
  2. The JS sourcemaps and the iOS dSYM files weren't uploaded. Is there a similar library (like sentry-android-gradle-plugin on Android) for iOS and the RN part? Or do we need to use the sentry-cli?

We've just uploaded the Android RN sourcemaps manually via sentry-cli and the sourcemaps are visible within the artifacts tab of the release. But the issue is not deobfuscated by sentry. Do you have any ideas? https://sentry.io/organizations/dmtech/issues/1143322943/?project=1516691&statsPeriod=14d

Hi, on react-native-sentry I can find this setting handlePromiseRejection to disable any HTTP rejection reports. How can I achieve that using @sentry/react-native? I wasn't able to find anything related to that.

@saschak42 I am not sure what you mean with the gradle file, you mean our current file is broken?

@spenciefy This is odd, the new SDK should do the same. Is this a release build? Is this iOS?

Can integrations be used with React Native now?

@vshab Yes, they can.

@msqar This indicates that autolinking didn't work, what version of react-native are you running?
Do other packages with a native integration work?

@crubier Did you upgrade your project? What version of react-native are you running and what steps did you take to install the SDK?

@SuddenH4X

  1. Yes, this is expected behaviour.
  2. You should use sentry-cli, yes. If you ran the wizard it should add a build step that does this for you, otherwise check this out https://docs.sentry.io/clients/react-native/manual-setup/#ios

The issue you linked is no longer available, but in order for the symbolication to work the release name + dist of the artifact need to match the tags in the event.

@HazAT I'm currently using 0.60.4 but i used to have 0.59. So i had to manually update my entire project whenever i updated it. Do you think linking gone wrong? it's possible... how does the linking work? And how is that handled?

This is my react-native.config.js

module.exports = {
    dependencies: {
        'react-native-device-info': {
            platforms: {
                ios: null,
                android: null
            }
        }
    },
    assets: [
        "./src/assets/fonts/"
    ]
};

I made sure i had exactly EVERY change that was dropped on 0.60.4 in terms of configuration and versioning but i might be failling on something, everything works except for autolinking?

@msqar In my experience, upgrading never works without issues.
Do

rm -rf node_modules
yarn install
react-native unlink @sentry/react-native
react-native link @sentry/react-native

@Genitivo did you solve your problem? I'm having the same issue when I try to build to release my app. @HazAT any suggestion? Looks like the problem is that the file 'index.android.bundle.packager.map' isn't being created on the directory, correct me if I'm wrong.

My stacktrace:

> Task :app:bundleReleaseJsAndAssets_SentryUpload FAILED INFO 2019-08-22 11:38:24.656279 -03:00 Loaded config from /Users/{my_user}/.sentryclirc DEBUG 2019-08-22 11:38:24.656753 -03:00 sentry-cli version: 1.47.1, platform: "darwin", architecture: "x86_64" INFO 2019-08-22 11:38:24.656771 -03:00 sentry-cli was invoked with the following command line: "/Users/{my_user}/Desktop/{my_project}/node_modules/@sentry/cli/sentry-cli" "--log-level" "debug" "react-native" "gradle" "--bundle" "/Users/{my_user}/Desktop/{my_project}/android/app/build/generated/assets/react/release/index.android.bundle" "--sourcemap" "/Users/{my_user}/Desktop/{my_project}/android/app/build/intermediates/sourcemaps/release/index.android.bundle.packager.map" "--release" "{my_android_release}" "--dist" "27" INFO 2019-08-22 11:38:24.658722 -03:00 bundle path: /Users/{my_user}/Desktop/{my_project}/android/app/build/generated/assets/react/release/index.android.bundle Processing react-native sourcemaps for Sentry upload. INFO 2019-08-22 11:38:24.658737 -03:00 sourcemap path: /Users/{my_user}/Desktop/{my_project}/android/app/build/intermediates/sourcemaps/release/index.android.bundle.packager.map > Analyzing 2 sources DEBUG 2019-08-22 11:38:24.658781 -03:00 Non-file bundle found DEBUG 2019-08-22 11:38:24.658851 -03:00 error: running update nagger DEBUG 2019-08-22 11:38:24.658864 -03:00 skipping update nagger because session is not attended error: No such file or directory (os error 2) DEBUG 2019-08-22 11:38:24.659374 -03:00 client close; no transport to shut down (from sentry)

VERSIONS:
React Native: "0.60.3",
Sentry: "@sentry/react-native": "1.0.0-beta.5"

@lucasfalcaojump I am able to create release builds, but in the Sentry's dashboard I can't see the updated build.
I'm currently on 1.0.0-beta.4 version.

Remember to substitute every com.android.support implementation with androidx and use jetify after you reinstall sentry.

Everything is beautiful, but I still don't see the RELEASE in the Sentry's dashboard of the project, so I solve only a piece of the problem.

@Genitivo , Thanks! You helped me a lot with your tips, but still isn't working to release... So I have to remove Sentry for now.

Hello there, we have found a crash with Sentry.setRelease('test') after a Sentry.init with the following devices:

  • Huawei P8 lite 2017 | Android 7.0
  • One Plus Fouz | Android 9.0

The error message is:

com.facebook.react.bridge.UnexpectedNativeTypeException: Value for message cannot be cast from ReadableNativeMap to String

@Minishlink I have the same in emulator with
"@sentry/react-native": "1.0.0-beta.5",

Hi, all.
I found problem.
Sentry not sending anything in dashboard (server) if device use Android 9 or 9.1 ,
Android 7, 8 and iOS is work fine

used: "@sentry/react-native": "1.0.0-beta.5",

I have a problem with uploading sourcemap:

> Task :app:bundleReleaseJsAndAssets_SentryUpload FAILED
  INFO    2019-08-23 17:40:28.156469 +03:00 Loaded config from /Users/{username}/.sentryclirc
  DEBUG   2019-08-23 17:40:28.157220 +03:00 sentry-cli version: 1.47.1, platform: "darwin", architecture: "x86_64"
  INFO    2019-08-23 17:40:28.157241 +03:00 sentry-cli was invoked with the following command line: "/Users/{username}/projects/{project_path}/node_modules/@sentry/cli/sentry-cli" "react-native" "gradle" "--bundle" "/Users/{username}/projects/{project_path}/android/app/build/generated/assets/react/release/index.android.bundle" "--sourcemap" "/Users/{username}/projects/{project_path}/android/app/build/intermediates/sourcemaps/release/index.android.bundle.packager.map" "--release" "net.clickclickdrive.mobile-1.9.0" "--dist" "342"
Processing react-native sourcemaps for Sentry upload.
  INFO    2019-08-23 17:40:28.159676 +03:00   bundle path: /Users/{username}/projects/{project_path}/android/app/build/generated/assets/react/release/index.android.bundle
> Analyzing 2 sources
  INFO    2019-08-23 17:40:28.159694 +03:00   sourcemap path: /Users/{username}/projects/{project_path}/android/app/build/intermediates/sourcemaps/release/index.android.bundle.packager.map
  DEBUG   2019-08-23 17:40:28.159781 +03:00 Non-file bundle found
  DEBUG   2019-08-23 17:40:28.458998 +03:00 error: running update nagger
  DEBUG   2019-08-23 17:40:28.459039 +03:00 skipping update nagger because session is not attended
error: No such file or directory (os error 2)
  DEBUG   2019-08-23 17:40:28.459658 +03:00 client close; no transport to shut down  (from sentry)

FAILURE: Build failed with an exception.

I found that the sourcemap that I have differs from what sentry-cli looks for:

I have:

$ ls  /Users/{usrename}/projects/{project_path}/android/app/build/generated/assets/react/release/
index.android.bundle     index.android.bundle.map

sentry-cli looks for:

> Analyzing 2 sources
  INFO    2019-08-23 17:40:28.159694 +03:00   sourcemap path: /Users/{usrename}/projects/{project_path}/android/app/build/intermediates/sourcemaps/release/index.android.bundle.packager.map
  DEBUG   2019-08-23 17:40:28.159781 +03:00 Non-file bundle found

Is there a way to specify sourcemap manually

Also, see my comment https://github.com/getsentry/sentry-react-native/issues/641#issuecomment-524620974 - in my case failure reason is ambiguity in a sourcemap output file name

Also managed to find out
https://github.com/getsentry/sentry-react-native/issues/612#issuecomment-524391084
If building debug APK (only for Android 9) is work fine, if build release APK not working, capture exceptions, messages and events

@sentry/react-native 1.0.0 has been released and the docs page has been updated see: https://docs.sentry.io/platforms/react-native/

I am closing this issue as of now, please consider opening new issues from now on since this thread is already quite large.

@HazAT which issue should we follow to track Hermes support?

Hi @HazAT, currently I'm facing a problem of Source code was not found in Url app:///index.android.bundle. I'm using Sentry together with Codepush, after using the command:

sentry-cli react-native appcenter --deployment Staging MyAppName android ./build/android/CodePush

Inthe Artifacts tab,index.android.bundleandindex.android.bundle.mapwere uploaded but theDistributionfields areNone. But my error includes bothrelease_nameanddist`, so it cannot map with those artifacts.

So my question is: How can I resolve this and are we missing the --dist option in sentry-cli react-native appcenter? Thank you.

@nenjamin2405 Yes, please add --dist to your sentry-cli upload command and make sure release / dist of the event matches the artifacts in releases. Then it should work just fine.

@HazAT But I cannot find --dist as an option in sentry-cli react-native appcenter -h. I already tried to use --dist but it's not a valid option

@nenjamin2405 Please open a new issue, I am locking this now since there is too much in here.

Was this page helpful?
0 / 5 - 0 ratings