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.

[Bug report] Undefined symbols for architecture x86_64 on Xcode build

See original GitHub issue

Goals

We are getting several errors Undefined symbols for architecture x86_64 when try to build (play) the React Native app with Xcode for iOS.

Here I report the example of two apps, with two different versions of Realm and React Native, both with the same problem.

To solve, we need to:

cd ios
rm -rf Pods
pod install

This happens several times a day, we have not yet discovered the reason.

My guess is that this is related to branch exchange. However, when changing branches, neither React Native nor Realm versions are changed. (ios/Pods and node_modules are ignored on GIT)

React Native 0.62.2 and RealmJS 6.0.2

image

React Native 0.61.5 and RealmJS 3.6.5

image

Steps to Reproduce

Unfortunately, we still haven’t found a standard behavior.

As @somebody32 says here https://github.com/realm/realm-js/issues/3221#issuecomment-723875769

Looks like it is happening every time there is a change in Pods (ie adding a new or upgrading a version of any pod, not Realm). Realm is 10.0.1.

The temporal solution is to clean the build and do pod install again (no need to remove pods or node_modules folder), but I agree that it is pretty time consuming

Code Sample

Both projects are created using react-native init, without any customization in the metro, babel or cocoapods scripts.

Version of Realm and Tooling

  • Realm JS SDK Version: 3.6.5 and 6.0.2
  • React Native: RN 0.61.5 and 0.62.2 both with cocoapods and autolinking
  • Cocoapods: 1.9.3
  • Xcode: 11.7 (11E801a)
  • Node: 12.16.3 with nvm
  • Client OS & Version: macOS Catalina 10.15.6 (19G2021)
  • Which debugger for React Native: None

Maybe related to https://github.com/realm/realm-js/issues/2271 https://github.com/realm/realm-cocoa/issues/2393

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:19
  • Comments:31 (5 by maintainers)

github_iconTop GitHub Comments

13reactions
somebody32commented, Nov 9, 2020

Looks like it is happening every time there is a change in Pods (ie adding a new or upgrading a version of any pod, not Realm). Realm is 10.0.1.

The temporal solution is to clean the build and do pod install again (no need to remove pods or node_modules folder), but I agree that it is pretty time consuming

3reactions
knethcommented, Jan 6, 2021

You can add something like

post_install do |installer|
  installer.pods_project.build_configurations.each do |config|
    config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
  end
end

to your app’s pod. See also https://stackoverflow.com/questions/63607158/xcode-12-building-for-ios-simulator-but-linking-in-object-file-built-for-ios

Read more comments on GitHub >

github_iconTop Results From Across the Web

Undefined symbols for architecture x86_64 - Apple Developer
I'm trying to create an application that sends keystrokes to another process and I keep getting this error: Undefined symbols for architecture x86_64:....
Read more >
Xcode build failure "Undefined symbols for architecture x86_64"
I am trying to write a very simple console program, that searches for paired BT devices and prints them to an NSLog. It...
Read more >
64316 (gcc9 @9.4.0_1 & gcc10 @10.3.0_1: build failure
gcc9 @9.4.0_1 & gcc10 @10.3.0_1: build failure: Undefined symbols for architecture x86_64. Reported by: i0ntempest, Owned by: i0ntempest.
Read more >
Undefined symbols for architecture x86_64 - 7348639
I am trying to build plugin for AI CC in Xcode 6.3.2- I have followed the doc "getting-started-guide.pdf", my project set up differ...
Read more >
[Xcode Build issue] -Undefined symbols for architecture ...
I got this error when building xcode by simulator: Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_BinaryFileStorageInterface", referenced from:.
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