6

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.

Ethan Chiu
  • 61
  • 1
  • 1
  • 5
  • Stupid one, but make sure you haven't #imported a .m file by mistake somewhere – aBilal17 May 26 '16 at 10:01
  • 9
    You can check this one as well. Changing 'No Common Blocks' from Yes to No ( under Targets->Build Settings->Apple LLVM - Code Generation ) fixed the problem. – aBilal17 May 26 '16 at 10:03
  • You can check the meaning and how to solve your error here in this [SO question](http://stackoverflow.com/questions/24298144/duplicate-symbols-for-architecture-x86-64?rq=1) – KENdi May 27 '16 at 06:08
  • @aBilal17 your answer is a copy of: http://stackoverflow.com/a/25666570/6124910 – Patrick May 27 '16 at 07:29
  • 1
    @Patrick its not an answer its a comment. – Quamber Ali Aug 10 '16 at 10:33
  • @Ethan Sometime we delete the files from project and the files are still in the directory of the project . So please check your directory if you have duplicate files or not . Nada Gamal – Nada Gamal Feb 17 '17 at 20:09

4 Answers4

2

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

Arthi
  • 128
  • 1
  • 7
1

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.

halfer
  • 19,824
  • 17
  • 99
  • 186
Er. Vihar
  • 1,495
  • 1
  • 15
  • 29
0

This problem can also be occurred in case you import ".m" file instead of ".h" by mistake. I know it may be seemed as a stupid advise but this is what I had done in my case.

brsr
  • 111
  • 2
  • 3
0

I resolved this issue by removing the -all_load flag in the Build Settings-> Other Linker flags.

Vishnuvardhan
  • 5,081
  • 1
  • 17
  • 33