Since I've updated to Xcode 8.1 I can't archive and also not run in Release mode (in debug mode its working). The error is that there are several "duplicate symbols for architecture arm64" and all are "duplicate symbol __TMRbBp". Whats that?
15 Answers
It seems to be a bug in Swift. See discussion on Apple developers portal
It is said to be fixed in Xcode version that is about to be released. But for now there is temporary workaround:
Go to your target Build Settings
and set Reflection Metadata Level
flag to None

- 2,352
- 1
- 22
- 27
-
1If you're using Cocoapods, refer to this https://stackoverflow.com/a/47114775/5854394 – Clark Wilson Nov 10 '17 at 22:48
Don't double click Project.xcodeproj to start your xcode project. Instead, close your project and open the xcworkspace.
File -> Close Workspace
File -> Open -> Search your project folder for Project.xcworkspace
All my errors are gone.

- 1,535
- 1
- 15
- 26
-
1Thank you very much! This is so obvious, I created a Podfile and mistakenly opened the file with the type .xcodeproj instead of .xcworkspace. – iAleksandr Feb 05 '19 at 16:36
I faced the same problem with archiving on Xcode 8.1.
X Code Version: Version 8.2.1 (8C1002)
The following fix worked on Mar 2019
1) Go to Project & Select your Project
2) Select Build Settings -
Search for "Enable Bitcode" Set option as "NO"
3) Most of version will fix this issue, for few other XCode version try this option also,
Search for "Reflection Metadata Level" Set option as "NONE"

- 2,747
- 1
- 33
- 33
I had similar issues with Version 9.2 (9C40b), the solution is
0) Close Xcode
1) Open project folder in terminal
2) pod update
3) open .
4) open project by clicking Project.xcworkspace

- 1,821
- 3
- 18
- 28
Surprisingly, in some occasions, simply cleaning the product worked for me.
- Product/Clean (Shift+Cmd+K)
- Product/Clean Build Folder (Alt+Shift+Cmd+K)
Quick fix to try before looking at other solutions.

- 5,824
- 3
- 25
- 32
1.Close your project:Completely quit Xcode. 2.Go to your project location:there you will find two files in you root folder with varying extensions: Appname.xcodeproj and Appname.xcworkspace
Now open your project by Double clicking on file with the extensions xcworkspace.(***Appname.xcworkspace*)**
Yourproject will open in xcode. Now run your project again.
If you pay close attention when installing your pods,firebase makes it clear to open your project with your-project.xcworkspace after installing pods firebaseIOS Setup
$ cd your-project directory
$ pod init
Add to Podfile
pod 'Firebase/Core'
And finally:
$ pod install
$ open your-project.xcworkspace
Dont forget to add firebase to your AppDelegate

- 2,536
- 25
- 30
If you're using Ionic and the Push and Console plugins that's the problem. Remove the cordova console plugin (which is deprecated) and the error will disappear.
The linker error is saying that a library is duplicated which is, in fact, true because the console plugin is already in cordova-ios 4.5+
It took me a couple of hours to figure this out!

- 1,337
- 17
- 22
In my case
- Select your project (In my case i have 2 targets)
- Go to Build Phases
- Compile Sources
- Check if the number of items on each targets is the same (mine was different)
- Add the missing file / Remove the duplicated file
Problem Solved

- 21
- 2
-
Great answer. I added a new Target to my XCode project. I did not select "Target Membership" for the old files but XCode auto added ( a file I didn't want ) to the `Compile Sources` list. That caused my duplicate Symbol. Removed. Worked. Boom!. – rustyMagnet Apr 17 '20 at 10:51
I ran into this problem recently creating a new project and adding some pods (AlamoFire specifically) to the project. Troubled with it a couple hours or so recreating the project (it was new) several times. Tried all the methods here and no luck.
Eventually I figured out that it was because XCode V10.1 was also opening the old project file along with the new pod-created workspace when I opened the workspace via command line "open myProject.xcworkspace" when I reopened the project after doing "pod install"
Closing all projects before exiting XCode before I did my "pod install" fixed everything for me.

- 450
- 4
- 15
close you project then open xcode go to file -> open search your project and open it . this worked for me

- 1,121
- 8
- 25
I got this error due to deletion of some files. For me simply cloning my project worked.

- 11
- 3
For those that can't get the Thorax's answer to work, what I did was I closed out Xcode, ran pod update
on my command line and then reopened the .xcworkspace file. After doing that, I was able to build and run the project.
I am using the Firebase Cocoapod and Xcode version 9.1.

- 1,277
- 2
- 11
- 27
I had removed files from Compile Sources in Build Phases in Targets. I added main.m
and it worked.

- 771
- 10
- 18
Had the same problem in Xcode 10.1 and was able to resolve it. In path Project Target > Build Setting > No Common Blocks
, I changed it to No
.

- 855
- 8
- 12
I had similar kind of problem when I added a framework to my project.
I have resolved the issue by removing the framework and again adding the framework to the project by dragging and dropping the framework file to the projects frameworks folder and selecting the Copy items if needed option.

- 122
- 2
- 12