Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

symbol(s) not found for architecture x86_64 in xcode 10

Tags:

xcode

ios

I have facing the problem in my ios project. symbols not found for architecture x86_64 in xcode clang: error: linker command failed with exit code 1 (use -v to see invocation)

enter image description here

Thanks in advance!!

like image 629
iSara Avatar asked Sep 19 '18 05:09

iSara


2 Answers

I had the exact same problem when running the unit tests for an application that had a custom framework as a dependency. The application was running fine but not its unit tests (I was getting the exact error shown above). I resolved it as follows: - Select the unit test target for the application (e.g. Tests) - Under "Testing" section enable "Allow testing Host Application APIs"

like image 155
DCDC Avatar answered Oct 14 '22 01:10

DCDC


In most cases this points to one or more missing references to frameworks in the section Linked Frameworks And Libraries in the Targets settings of the app in Xcode.

To find out which framework reference should be added:

  • Right-click on the error in the build time errors list
  • Choose 'Reveal in Log',
  • Search in the log for 'Undefined symbols for architecture x86_64'
  • A list of undefined 'symbols' (mostly class methods and properties) is displayed
  • To find out which framework reference should be added, select such undefined symbol, right-click and choose Search with Google
  • In most cases you'll end up in the documentation of Apple, which should give a clue about the related framework
  • Add the framework in the section Linked Frameworks And Libraries by clicking on the + button.
  • Build the app.
  • If necessary, repeat this procedure for remaining undefined 'symbols'.
like image 24
Ely Avatar answered Oct 13 '22 23:10

Ely