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 modal message "could not connect to Sentry native SDK" #662

Closed
3 tasks
dark4eg opened this issue Sep 17, 2019 · 18 comments
Closed
3 tasks

Comments

@dark4eg
Copy link

dark4eg commented Sep 17, 2019

OS:

  • Windows
  • [*] MacOS
  • Linux

Platform:

  • [*] iOS
  • [*] Android

SDK:

  • [*] @sentry/react-native: 1.0.5
  • react-native-sentry

react-native version: 0.60.4, 0.60.5

Init Code:

import * as Sentry from "@sentry/react-native";
 
Sentry.init({
  dsn: "__DSN__" // i'm use __DSN__ = real dsn app
});
 
Sentry.setTag("myTag", "tag-value");
Sentry.setExtra("myExtra", "extra-value");
Sentry.addBreadcrumb({ message: "test" });
 
Sentry.captureMessage("Hello Sentry!");

I have following issue:
After starting, I see a modal message "Warning, could not connect to Sentry native SDK".
If you do not want to use the native component please pass enableNative: false in the options. Visit: https://docs.sentry.io/clients/react-native/ for more details."

Thanks in advance for the answers.

  1. Why does the link in the message lead to the documentation for the deprecated project?
  2. Why am I referring to this modal message, how do I resolve this issue?
  3. What should i use now for react-native 0.60+ sentry-react-native или @sentry/react-native?

Steps to reproduce:

  • react-native init AwesomeProject
  • cd AwesomeProject
  • npm i
  • npm install --save @sentry/react-native
  • in directory AwesomeProject run react-native start
  • run ios and android app
@dark4eg dark4eg changed the title @ sentry/Reaction-native - Поддержка Гермес @ sentry/react-native modal message "could not connect to Sentry native SDK" Sep 17, 2019
@HazAT
Copy link
Member

HazAT commented Sep 18, 2019

Thanks for pointing out that it guides to the old documentation.
Did you run pod install as stated in the docs?
https://docs.sentry.io/platforms/react-native/#linking

@dark4eg
Copy link
Author

dark4eg commented Sep 18, 2019

@HazAT Sorry, iOS build is working.
Build for android showed Modal message.

@HazAT
Copy link
Member

HazAT commented Sep 25, 2019

I just tried a clean project react-native init project it worked without issues, I need a reproduction case for this.
Make sure you linked the dependency correctly.

@HazAT HazAT closed this as completed Sep 25, 2019
@nateblog
Copy link

proper linking sorted this out for me by adding

pod 'RNSentry', :path => '../node_modules/@sentry/react-native'

then pod install

"@sentry/react-native": "1.3.1",

@jamesdunay
Copy link

Anyone find a solution to this? Running into the same issue right now. I've reinstalled all node_modules and walked through the wizard. Tried 'npm link' as well as pod install, neither had any effect.

Seeing it on both iOS and Android, in addition, interestingly enough, even when i use the flag enableNative:false, I still get the warnings.

"@sentry/react-native": "^1.4.1",
"react-native": "0.62.2",

@waqaramjad
Copy link

same issue

@muriloneo
Copy link

same

@jennmueng
Copy link
Member

@jamesdunay @muriloneo @waqaramjad Can you try updating to the latest 1.7.0 and see if the issue persists? This just sounds like incorrect installations to me.

@muriloneo
Copy link

solved with enableNative: process.env.NODE_ENV == 'development' ? false : true on init

@jennmueng
Copy link
Member

solved with enableNative: process.env.NODE_ENV == 'development' ? false : true on init

@muriloneo I highly recommend against doing that as if something is wrong with your installation you would not get notified on development and it could crash your production builds.

@muriloneo
Copy link

I've removed, reinstalled, tried a lot of things and nothing made it work.

Yesterday was working. The only thing that helped was that.

@jennmueng
Copy link
Member

@muriloneo Is the issue your seeing a YellowBox that says "Note: Native Sentry SDK is disabled." ?

@muriloneo
Copy link

No.
An alert box.

image

@jennmueng
Copy link
Member

No.
An alert box.

image

@muriloneo This means that the SDK is not linked correctly, if you enable this in production it would crash the app.

@muriloneo
Copy link

I'll test relase in a few.

But my installation was perfect yesterday. Today woke up with this error.
As I said, removed, cleaned, reinstalled, wizard (3 times) and nothing. Really don't know what to do.

@jennmueng
Copy link
Member

@muriloneo Hmm did it install a newer version in the background or something? But yeah, at the very least I strongly suggest if you want to disable native crash handling to just do enableNative: false because the error you have there would crash on production.

@cervebar
Copy link

cervebar commented Jun 26, 2023

I have the same issue with @sentry/react-native": "5.0.0", and RN 0.68.3. Any ideas?

@krystofwoldrich
Copy link
Member

@cervebar This issue is very old, it might be better to open a new one with more details about your app, are you using Expo, how do you build your app...?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants