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

Latest version (5.3.1) does not compile under react-native-macos #3000

Closed
5 of 12 tasks
ospfranco opened this issue Apr 23, 2023 · 3 comments · Fixed by #3007
Closed
5 of 12 tasks

Latest version (5.3.1) does not compile under react-native-macos #3000

ospfranco opened this issue Apr 23, 2023 · 3 comments · Fixed by #3007

Comments

@ospfranco
Copy link
Contributor

OS:

  • Windows
  • MacOS
  • Linux

Platform:

  • iOS
  • Android
  • MacOS

SDK:

  • @sentry/react-native (>= 1.0.0)
  • react-native-sentry (<= 0.43.2)

SDK version: 0.0.0

react-native-macos version: 0.71.2

Are you using Expo?

  • Yes
  • No

Are you using sentry.io or on-premise?

  • sentry.io (SaaS)
  • on-premise

If you are using sentry.io, please post a link to your issue so we can take a look:

[Link to issue]

The latest version of the library does not compile under MacOS for MacOS. I've created the following patch:

diff --git a/node_modules/@sentry/react-native/.DS_Store b/node_modules/@sentry/react-native/.DS_Store
new file mode 100644
index 0000000..36d39ae
Binary files /dev/null and b/node_modules/@sentry/react-native/.DS_Store differ
diff --git a/node_modules/@sentry/react-native/ios/RNSentry.mm b/node_modules/@sentry/react-native/ios/RNSentry.mm
index 78b0a24..d5a75e3 100644
--- a/node_modules/@sentry/react-native/ios/RNSentry.mm
+++ b/node_modules/@sentry/react-native/ios/RNSentry.mm
@@ -311,6 +311,8 @@ RCT_EXPORT_METHOD(captureEnvelope:(NSArray * _Nonnull)bytes
     resolve(@YES);
 }
 
+#if SENTRY_HAS_UIKIT
+
 RCT_EXPORT_METHOD(captureScreenshot: (RCTPromiseResolveBlock)resolve
                   rejecter: (RCTPromiseRejectBlock)reject)
 {
@@ -354,6 +356,8 @@ RCT_EXPORT_METHOD(fetchViewHierarchy: (RCTPromiseResolveBlock)resolve
     resolve(viewHierarchy);
 }
 
+#endif
+
 RCT_EXPORT_METHOD(setUser:(NSDictionary *)userKeys
                   otherUserKeys:(NSDictionary *)userDataKeys
 )
@krystofwoldrich
Copy link
Member

Hi, thank you for the info, the fix looks good.

Would you be willing to open a PR with the mentioned fix?

@ospfranco
Copy link
Contributor Author

Hey, little time right now to fork the repo and apply the changes? can't you do it, it's a two line change :)

@krystofwoldrich
Copy link
Member

@ospfranco Of course, no problem, just wanted to check if you are not interested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
2 participants