Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@sentry/react-native - Tracking Issue - Feedback #612

Closed
6 of 7 tasks
HazAT opened this issue Jul 3, 2019 · 164 comments
Closed
6 of 7 tasks

@sentry/react-native - Tracking Issue - Feedback #612

HazAT opened this issue Jul 3, 2019 · 164 comments

Comments

@HazAT
Copy link
Member

HazAT commented Jul 3, 2019

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

  • Support for react-native >= 0.60
  • Use @sentry/browser
  • Supports autolinking
  • 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/react-native@1.0.0-beta.5

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

  • Use symbolicateStackTrace of react-native to symbolicate on device in Debug.
  • Check stacktrace merging
@HazAT HazAT self-assigned this Jul 3, 2019
@HazAT HazAT pinned this issue Jul 3, 2019
@Karniej

This comment has been minimized.

@HazAT

This comment has been minimized.

@HazAT

This comment has been minimized.

@pvinis

This comment has been minimized.

@AleksandrZhukov

This comment has been minimized.

@HazAT

This comment has been minimized.

@HazAT

This comment has been minimized.

@AleksandrZhukov

This comment has been minimized.

@HazAT

This comment has been minimized.

@Karniej

This comment has been minimized.

@HazAT

This comment has been minimized.

@Karniej

This comment has been minimized.

@msqar

This comment has been minimized.

@AleksandrZhukov

This comment has been minimized.

@Psiiirus

This comment has been minimized.

@Psiiirus

This comment has been minimized.

@cihati

This comment has been minimized.

@Psiiirus

This comment has been minimized.

@msqar
Copy link

msqar commented Aug 3, 2019

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?

@crubier
Copy link

crubier commented Aug 4, 2019

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 ?

@SuddenH4X
Copy link

SuddenH4X commented Aug 7, 2019

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?

@SuddenH4X
Copy link

SuddenH4X commented Aug 7, 2019

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

@ricbermo
Copy link

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.

@HazAT
Copy link
Member Author

HazAT commented Aug 19, 2019

@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.

@msqar
Copy link

msqar commented Aug 19, 2019

@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?

@HazAT
Copy link
Member Author

HazAT commented Aug 20, 2019

@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

@lucasfalcaoo
Copy link

lucasfalcaoo commented Aug 22, 2019

@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"

@Genitivo
Copy link

@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.

@lucasfalcaoo
Copy link

@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.

@Minishlink
Copy link

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

@radik
Copy link

radik commented Aug 23, 2019

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

@webforuse
Copy link

webforuse commented Aug 23, 2019

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",

@radik
Copy link

radik commented Aug 25, 2019

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

@radik
Copy link

radik commented Aug 25, 2019

Also, see my comment #641 (comment) - in my case failure reason is ambiguity in a sourcemap output file name

@webforuse
Copy link

Also managed to find out
#612 (comment)
If building debug APK (only for Android 9) is work fine, if build release APK not working, capture exceptions, messages and events

@HazAT
Copy link
Member Author

HazAT commented Sep 2, 2019

@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 HazAT closed this as completed Sep 2, 2019
@HazAT HazAT unpinned this issue Sep 2, 2019
@canastro
Copy link

canastro commented Sep 2, 2019

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

@HazAT
Copy link
Member Author

HazAT commented Sep 2, 2019

@canastro #649

@nathantqn
Copy link

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 both release_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.

@HazAT
Copy link
Member Author

HazAT commented Sep 24, 2019

@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.

@nathantqn
Copy link

nathantqn commented Sep 24, 2019

@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

@HazAT
Copy link
Member Author

HazAT commented Sep 25, 2019

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

@getsentry getsentry locked as resolved and limited conversation to collaborators Sep 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests