106 duplicate symbols for architecture armv7
Asked Answered
J

7

6

Working on my iPhone app and trying to build for debug and I get "106 duplicate symbols for architecture armv7"?

I am using the .workspace file because I am trying to use CocoaPods. If I don't use the .workspace and instead use the .xcodeproj I don't get the error, but then I get missing -lPods .

In my project I have the following targets in the Project Navigator.

Pods (blue icon)
MyProject (blue icon)
  Restkit.xcodeproj (blue icon)
  ... all my files

The issue is that Restkit is making reference to "AFHTTPClient.h" and all the other AF code, but I included it via CocoaPods. I tried deleting the AFNetworking folder from the RestKit library, but apparently the Restkit library can't find the Pods version of AFNetworking?

Is there a way to get RestKit to use the Pods version? If not how do I go about removing Pods from my project?

Jari answered 5/12, 2012 at 15:54 Comment(1)
For the benefit of others: I had this error after deleting some classes that I didn't need anymore. I had to do a Clean before being able to successfully Compile again.Ghost
L
6

There is a line in one of your .h files where your wrote

#include "___.m"

instead of

#include "___.h"
Lifelong answered 30/8, 2013 at 9:11 Comment(0)
J
2

So I fixed it. After removing the RestKit version of AFNetworking, from the vendor folder, I added it back by dragging into Xcode. It asks which project I want it used/copied to and this time I selected RestKitTest (or whatever the RestKitTesting is named). It works now. Maybe I selected both RestKit and RestKitTest before, which was wrong?

Jari answered 5/12, 2012 at 15:58 Comment(0)
R
2

I also came up with same error. Generally this kind of error occurs due to duplicate classes and xibs in project folder. For Example in my project I had these classes twice ServiceRequest.h/.m. Get rid of duplicate ones and you are good to go.

Rois answered 15/2, 2013 at 19:55 Comment(0)
L
2

In Build Phases -> Compile Sources, make sure you don't have the same file added twice.

Lynnalynne answered 13/6, 2013 at 21:47 Comment(0)
W
2

"Duplicate symbols for architecture" issue occurs in two situations:

  1. You added a .m file twice into your project

  2. You're using a static library (.a file) which already includes some classes that you include into the project.

For fixing any of those cases, check the linker error and look for the .o files that are duplicated (sample: Reachability.o).

Then go to the build phases -> compile sources and search the specified files, if any one appears twice delete one of them, if only appears once it means that the file is also included in one of the static libraries added to your project. Delete it from your list of sources to be compiled and try again.

Wistrup answered 23/10, 2013 at 8:37 Comment(1)
YOU ARE AWESOME , I had many errors while trying to add GoogleAnalytics to my project, One of my solutions was to add libGoogleAnalytics.a to Build Phases, But it failed and I forgot to remove it XD.Anglomania
P
0
  • I saw this error when, I did drag and drop my calabash framework onto xcode and selected add to targets option in the window thats shown. Basically there were two references to files added I had to remove the calabash framework manually

  • Right way of doing it

    copy to calabash framework to project directory then go to xcode project Choose target -> Build phases -> Link Binary With Libraries and add the frame work using + button

Pioneer answered 24/5, 2013 at 13:50 Comment(0)
L
0

I have noticed that duplicate symbols are caused for Google analytics after installing cocoaPods as well. Once I removed one of archives, either libGoogleAnalytics_debug.a or libGoogleAnalytics.a duplication has gone. But obviously if I removed debug one I will not be able to run os simulator and vica versa. I know its not the solution, but at least it could give an idea what could be a solution. Will come back to this thread if I will figure out how to have both a files in this case.

Edit: I was able to solve the issue by upgrading from G analytics version 2 to 3. It has only one library file and I guess this is the reason why we don't get duplicated symbols anymore. I hope it makes sense.

Lurlinelusa answered 18/10, 2013 at 23:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.