On install, native iOS SDK is not added to RN<0.60 project
See original GitHub issueEnvironment
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
yarn add @sentry/react-native
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 🎉
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 🎉
cd ios; pod install
[!] No `Podfile' found in the project directory.
- 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 retryingpod install
fails with errorUnable to find a specification for 'React-Core' depended upon by 'RNSentry'
.
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (8 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
OK
In the mean time…
For whoever still running RN<0.60 who might stumble on this issue, and until this issue this closed:
react-native link @sentry/react-native
or manually linking in Xcode/AndroidStudio. 1.3.8 is when thereact-cocoa
submodule was removed and the Sentry.xcodeproj reference was broken.React-Core
toReact/Core
@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.