Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 7 simulator error "duplicate symbols for architecture x86_64"

My development environment with Xcode 7.2.1, CocoaPods 1.0.0 and GoogleMaps 1.13.2

I can build code successful to generate a XXX.ipa file and install in my iPhone 6 Plus to work correctly.

But when I run Xcode simulator by item "iPhone 6" or "iPhone 6 Plus" always get the information as below

"xxxx duplicate symbols for architecture x86_64" "linker command failed with exit code 1 (use -v to see invocation)"

I use the following solutions still can't fix it

  1. Build Options -> Enable Bitcode -> set "No"

  2. Remove -ObjC from Other Linker Flags

  3. project Targer -> Build phases -> compile sources, ckeck no duplicate files

  4. Make sure I haven't #imported a .m file

I am wondering if there are any other method to solve this, help would be appreciated thanks.

like image 666
Ethan Chiu Avatar asked May 26 '16 09:05

Ethan Chiu


People also ask

What does 1 duplicate symbol for architecture x86_64 mean?

Well, it means we're trying to link the same symbol name (in our case, a method) from two (or more) different source files. The fix was easy: rename one of the methods by updating the header file, the source file (. c or .

What is undefined symbols for architecture x86_64?

Why Is the Undefined Symbols for Architecture x86_64: Error Happening? This error is happening due to the lack of included values inside the declared statements in your code. The browser is going to render the information incorrectly and show this error, especially if you are working with Main and Similarity tools.

How do I turn off no common blocks in Xcode?

One was to navigate to Diary in project navigator, select Build Settings, scroll down to Apple LLVM 6.1 Code Generation and change the No common blocks option to No .

What does duplicate symbol mean in C++?

Duplicate symbols occur when you have both added an implementation file (. cpp) to your project and #included it. This way, the implementation file (. cpp) gets compiled twice: once as a module in your project (as it is added to your project) and subsequently as a piece of #included code.


2 Answers

This error generally occurs when you have linked any library or file twice. In the error desciption, the name of the duplicated file will be listed, you can search and and make sure you don't have duplicates. If you find duplicates, remove reference to one of them to play safe

like image 135
Arthi Avatar answered Oct 06 '22 00:10

Arthi


I have faced similar kind of issue.

In my application I have run my code and created ipa before two day. And today when I am trying to run same code without any changes I am getting:

ld: 102 duplicate symbols for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

The solution for this duplication Linker error can be solved by Remove all of your classes from compile sources, then click the + button and search for the term '.m'. Highlight every class, then click add. Build and run again.

like image 26
Er. Vihar Avatar answered Oct 06 '22 00:10

Er. Vihar