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.

iOS fails to build after setup with cocoa pods

See original GitHub issue

OS:

  • 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:

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:closed
  • Created 4 years ago
  • Reactions:8
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

7reactions
kristerkaricommented, Sep 18, 2019

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.

2reactions
kristerkaricommented, Sep 18, 2019

to add to my comment:

I was doing an update from React Native 0.59.10 to 0.60.5 and at the same time changed from react-native-sentry to @sentry/react-native.

It seems that it caused some old files to be cached by the iPhone simulator.

Read more comments on GitHub >

github_iconTop 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 >

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