question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

On install, native iOS SDK is not added to RN<0.60 project

See original GitHub issue

Environment

How do you use Sentry?

Sentry SaaS (sentry.io)

Which SDK and version?

@sentry/react-native 3.2.12 react-native 0.59.10 Xcode 13.2.1 sentry-wizard 1.2.17 sentry-cli 1.71.0

Steps to Reproduce

We follow instructions outlined at https://docs.sentry.io/platforms/react-native/#install

  1. yarn add @sentry/react-native
  2. yarn run react-native link @sentry/react-native
✅ Patched build.gradle file.
✅ Patched App.js file.
✅ Added sentry.properties file to android
Successfully set up android for react-native
✅ Patched build script in Xcode project.
✅ Patched App.js file.
✅ Added sentry.properties file to ios
Successfully set up ios for react-native
🎉  Successfully set up Sentry for your project 🎉
  1. yarn run sentry-wizard -i reactNative -p ios
Running Sentry Wizard...
version: 1.2.17 | sentry-cli version: 1.71.0
Sentry Wizard will help you to configure your project
Thank you for using Sentry :)
will not configure android
will not configure ios
Skipping connection to Sentry due files already patched
🎉  Successfully set up Sentry for your project 🎉
  1. cd ios; pod install
[!] No `Podfile' found in the project directory.
  1. Go to Xcode, press “Run”

Expected Result

Xcode project should build.

Actual Result

Build fails during compilation of RNSentry.m w/ error 'Sentry/Sentry.h' file not found.

The error makes sense since that file is nowhere to be found either in DerivedData or in the project.

Android project builds fine.

Comment

The problem might be linked to the failed pod install, but 2 things make me doubt that:

  • nothing in documentations explicitly mentions the dependency on CocoaPods.
  • creating a ios/Podfile file w/ pod 'RNSentry', :podspec => '../node_modules/@sentry/react-native/RNSentry.podspec' and retrying pod install fails with error Unable to find a specification for 'React-Core' depended upon by 'RNSentry'.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
guillaumekhcommented, Jan 21, 2022

We will explore options of re-adding support for those prior versions or instead bump our minimum requirement.

OK

In the mean time…

For whoever still running RN<0.60 who might stumble on this issue, and until this issue this closed:

  • 1.3.7 is the latest version which can be installed without Cocoapods. It can be installed w/ react-native link @sentry/react-native or manually linking in Xcode/AndroidStudio. 1.3.8 is when the react-cocoa submodule was removed and the Sentry.xcodeproj reference was broken.
  • 1.8.2 is the latest version which can be installed by following current documentations. It requires Cocoapods, and a writing a Podfile.
  • current version (3.2.12 as of writing) is installable by following current documentations. It requires Cocoapods, a Podfile, and patching the RNSentry.podspec to replace the dependency from React-Core to React/Core
0reactions
jennmuengcommented, Jan 21, 2022

@guillaumekh Thank you for bringing everything up and writing the guide! I’ll add it to our troubleshooting page and possibly a podfile script that’ll handle the React-Core issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React-native/iOS app: Module 'SquareInAppPaymentsSDK ...
So my suggestion for you is to create a new react-native project install all the library in the package.json one by one from...
Read more >
Add Expo to an existing project
Learn how to add Expo SDK to an existing React Native project. ... in your project, you can use npx expo install to...
Read more >
React Native SDK Troubleshooting - Visual Studio App Center
Go to ios folder of your project and remove Podfile.lock and the Pods folder. Run pod install --repo-update in your ios folder. Verify...
Read more >
react-native-community/datetimepicker - npm
React Native date & time picker component for iOS, Android and Windows. ... command expo install @react-native-community/datetimepicker (not ...
Read more >
Linking Libraries - React Native
Not every app uses all the native capabilities, and including the code ... rely on some native code, in that case you'll have...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found