iOS fails to build after setup with cocoa pods
See original GitHub issueOS:
- Windows
- MacOS
- Linux
Platform:
- iOS
- Android
SDK:
-
@sentry/react-native
-
react-native-sentry
react-native
version: 0.59.10
xcode
version 10.3
Init Code:
Sentry.init({
dsn: 'abcde@sentry.io/1234'
});
I have following issue:
I have installed react-native-sentry using cocoa pods I can run the app locally using the react-native cli, but if I try to build through xcode I the build fails due to:
ld: 294 duplicate symbols for architecture x86_64
Steps to reproduce:
- Install react-native-sentry using pod installation guide and try to run the app through xcode in debug mode
Actual result:
- Build fails with following output:
duplicate symbol _OBJC_IVAR_$_SentryUser._userId in:
/Users/user/Library/Developer/Xcode/DerivedData/app-gsrsnnhwyiekueaappkouvpynhfx/Build/Products/Debug-iphonesimulator/libRNSentry.a(SentryUser.o)
/Users/user/Library/Developer/Xcode/DerivedData/app-gsrsnnhwyiekueaappkouvpynhfx/Build/Products/Debug-iphonesimulator/Sentry/libSentry.a(SentryUser.o)
duplicate symbol _OBJC_IVAR_$_SentryUser._extra in:
/Users/user/Library/Developer/Xcode/DerivedData/app-gsrsnnhwyiekueaappkouvpynhfx/Build/Products/Debug-iphonesimulator/libRNSentry.a(SentryUser.o)
/Users/user/Library/Developer/Xcode/DerivedData/app-gsrsnnhwyiekueaappkouvpynhfx/Build/Products/Debug-iphonesimulator/Sentry/libSentry.a(SentryUser.o)
ld: 294 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Expected result:
- It should build successfully
Issue Analytics
- State:
- Created 4 years ago
- Reactions:8
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Trouble with installing cocoapods | Apple Developer Forums
[!] Xcode - develop for iOS and macOS ✗ CocoaPods installed but not working. You appear to have CocoaPods installed but it is...
Read more >Error installing cocoapods: ERROR: Failed to build gem native ...
Run following command brew cleanup -d -v. Then run below command brew install cocoapods. Note: If you see failed to link then run...
Read more >CocoaPods installation failure when building for iOS
CocoaPods installation failure when building for iOS · 1. Right-click on the folder with the assembled build and click the "New Terminal at ......
Read more >That pesky Xcode 13.2+ build error after pod install - Medium
Recently Xcode command line tools had some breaking changes. So what they did was change the default values for some xcode project build...
Read more >Troubleshooting - CocoaPods Guides
After upgrading from macOS 10.8 to 10.9 the installed CocoaPods gem doesn't work anymore, even after re-installing the gem. To solve this, you...
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 Free
Top 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
I had the same problem, but manged to figure out from the error messages that the duplicate symbols are related to some kind of caching that the iPhone simulator does.
so I opened
ios/DerivedData/MYPROJECTNAME/Build/Products/Debug-iphonesimulator/
and deleted all files and folders that were related to Sentry. I ran the build again from XCode, and the error went away.to add to my comment:
I was doing an update from React Native
0.59.10
to0.60.5
and at the same time changed fromreact-native-sentry
to@sentry/react-native
.It seems that it caused some old files to be cached by the iPhone simulator.