Sentry-react-native: #import <React/RNSentry.h> file not found

Created on 16 Mar 2017  路  14Comments  路  Source: getsentry/sentry-react-native

Hello,

I am trying to add the native crash handler to the project. Are you guys sure this is the right import? I have tried to add the path to the Library in Header Search Paths, but I can't get it working.

Most helpful comment

I just experienced this issue as well. I'm on:

"react-native": "0.50.3"
"react-native-sentry": "^0.34.0"

What I did:
npm install --save react-native-sentry (strangely the sentry wizard wasn't firing up)
react-native link react-native-sentry
...
馃帀 Successfully set up Sentry for your project 馃帀

I found that there was not Sentry folder under ios/Pods. Is this normal behaviour?
When I manually run pod install inside the ios folder, I get the following error:

[!] CocoaPods could not find compatible versions for pod "Sentry":
  In Podfile:
    SentryReactNative (from `../node_modules/react-native-sentry`) was resolved to 0.34.0, which depends on
      Sentry (~> 3.10.0)

When building the project in xcode, I get the aformentioned error (RNSentry.h) not found.

Update: Ah! My cocoapods repo was out of date! If you get this error, try:

cd ios
pod repo update
pod install

Perhaps this step should be included in the sentry link wizard @HazAT ?

All 14 comments

What I have also noticed is that it slows down the whole app and adds 30mb of swift libraries. It's not ideal. :\

@edo1493 We are also experiencing the issues with the app slowdown. Our app has become majorly slow to the point of where its impossible to use it.

The #import <React/RNSentry.h> is the new way for importing stuff in react since version >= 0.40 ... check if you have react-native at least in this version then the import should work.

Regarding the slow down stuff, please try to deactivate the stacktrace merging by passing

Sentry.config("DSN", {
  deactivateStacktraceMerging: true
}).install();

and check if the app is still slow.

Hi @HazAT, yes, it's the new way. I had a doubt since Sentry is not part of "React"? I thought it was .

I will trying to deactivate the stacktrace, because with it, the app is not usable. Further, adding the Swift libraries brings in 40-50mb in the project.

In regards to swift ...

Yeah we are aware of that and we know it's not super awesome.
We are still discussing internally if we should provide an objc version, even though we decided to go with swift for now.

Please post you results if deactivateStacktraceMerging fixed the performance problem.
If so we will check what's happening.

We currently working on making it faster, after some more tests we will release a new version which should fix the performance issues.

Hey I've just released 0.4.0 which should fix the performance issues

@robbiet480 ^^

We've changed the way imports work so it's also backwards compatible for react-native 0.38 probably further downwards.
Closing this for now ...

I just experienced this issue as well. I'm on:

"react-native": "0.50.3"
"react-native-sentry": "^0.34.0"

What I did:
npm install --save react-native-sentry (strangely the sentry wizard wasn't firing up)
react-native link react-native-sentry
...
馃帀 Successfully set up Sentry for your project 馃帀

I found that there was not Sentry folder under ios/Pods. Is this normal behaviour?
When I manually run pod install inside the ios folder, I get the following error:

[!] CocoaPods could not find compatible versions for pod "Sentry":
  In Podfile:
    SentryReactNative (from `../node_modules/react-native-sentry`) was resolved to 0.34.0, which depends on
      Sentry (~> 3.10.0)

When building the project in xcode, I get the aformentioned error (RNSentry.h) not found.

Update: Ah! My cocoapods repo was out of date! If you get this error, try:

cd ios
pod repo update
pod install

Perhaps this step should be included in the sentry link wizard @HazAT ?

You don't have to install Sentry with cocoapods.

In XCode, go to General => Linked Frameworks and Libraries => add libRNSentry.a

You don't have to install Sentry with cocoapods.

In XCode, go to General => Linked Frameworks and Libraries => add libRNSentry.a

From where do you get libRNSentry.a ?
I do not see it in my list. Any help please?

@SamiChab Please ignore my query.

Got the answer by looking at this:
https://github.com/getsentry/react-native-sentry/issues/344#issuecomment-362354851

I just experienced this issue as well. I'm on:

"react-native": "0.50.3"
"react-native-sentry": "^0.34.0"

What I did:
npm install --save react-native-sentry (strangely the sentry wizard wasn't firing up)
react-native link react-native-sentry
...
馃帀 Successfully set up Sentry for your project 馃帀

I found that there was not Sentry folder under ios/Pods. Is this normal behaviour?
When I manually run pod install inside the ios folder, I get the following error:

[!] CocoaPods could not find compatible versions for pod "Sentry":
  In Podfile:
    SentryReactNative (from `../node_modules/react-native-sentry`) was resolved to 0.34.0, which depends on
      Sentry (~> 3.10.0)

When building the project in xcode, I get the aformentioned error (RNSentry.h) not found.

Update: Ah! My cocoapods repo was out of date! If you get this error, try:

cd ios
pod repo update
pod install

Perhaps this step should be included in the sentry link wizard @HazAT ?

this work for me

Was this page helpful?
0 / 5 - 0 ratings

Related issues

juhaelee picture juhaelee  路  3Comments

KevinColemanInc picture KevinColemanInc  路  3Comments

jamesone picture jamesone  路  3Comments

kriptonhaz picture kriptonhaz  路  3Comments

deathemperor picture deathemperor  路  3Comments