XCode 8.1 -> duplicate symbol __TMRbBp

Hi All,


I'm stumped and I'm hoping someone out there can comment on this. Under XCode 8.0 my project builds without issues. Under the 8.1 GM and final 8.1 from the App Store the same project results in the error for three swift files that I've created.

duplicate symbol __TMRbBp


First off, any idea what TMRbBp is? Google wasn't helpful here.


I've looked at the linker settings to make sure I'm not double-linking in libraries.


The target that's complaining is a TodayView Extension target. Two of the three source files are also compiled into the main host app, but I can't think of a reason why that would matter. Many other files are built/included the same way.


Thanks for any help and suggestions,

Wes

Replies

I am also experiencing this. I was able to get my project down 2 lines of code, but it doesn't make sense why they would effect each other in any way. I submitted a bug report (radar 28952598) with the entire frameowork I'm trying to archive.

Same problem here when archiving (or compiling release schema), error points to two class with inherit relationship, the strange thing is that it just for specific class, but no luck if only to changed the class name.


I empty the class implementation, then the two .o files (for the two classed) are dispear, but two other files (include classes with inherit relationship) are listed in the error.

Same problem here. Also changed class name, but problem still appear. Archive with Xcode 8.0 is fine

Having the same problem with archiving on Xcode 8.1.

Same problem. My two files are both extensions of a class (in another file).


Building in a debug configuration works around it, but that's a non-solution.

David, it would be worth adding the information from this thread to your bug report.

One solution is to add "Final" to the class definition. I resolved the problem for one of my project


But for another my project, I found the class inherit relationship is compicated, for example classA inherit classB, classB inherit classC, as no way to add "final" to classB, the problem can not be resolved. If no other solution, I may have to change the class inherit relationship to just two levels.

Also see the Swift bug report about this issue, I've attached a sample project there, and there is a small workaround that at least fixed our case https://bugs.swift.org/browse/SR-3081

> I was able to get my project down 2 lines of code, but it doesn't make sense why they would effect each other in any way

Could you share your sample project to investigate this issue?

We managed to fix this in ProcedureKit with this change: https://github.com/ProcedureKit/ProcedureKit/pull/559/commits/37b4677d2ac95b00c52038a3be95cbc97639dfd9


If you have similar problems, look in the mentioned files for function overloading, or passing functions as arguments, and rewrite them.


I also raised this as a Swift bug: https://bugs.swift.org/browse/SR-3081

I managed to solve the problem from my side. It was a reduce method that was causing the issue. Refactored the code as a for loop instead of reduce and got past the error. Seems like an Xcode bug as the error message seems totally irrelevant. Try to track down the code that causes this behavior until Apple fixes it on Xcode side.

Could you post the reduce that caused the problem ?

This has now been fixed on Swift master, so hopefully it's out soon!

I also experienced this issue after upgrading to Xcode 8.1. I was able to get around it by following the workaround described here:


https://stackoverflow.com/questions/40365354/xcode-8-1-linker-command-failed-with-exit-code-1-duplicate-symbol-tmrbbp


In a nutshell: Go to your target Build Settings and set Reflection Metadata Level flag to None

Sorry for the delay. The reduce was this:

let params = login.reduce([String: Any](), paramsDataElementToDictionary)


and paramsDataElementToDictionary was

func paramsDataElementToDictionary(_ dict: [String: Any], element: (key: Param, value: Any)) -> [String: Any] {


which was refactored to

func dictionary(from params: ParamsData) -> Dictionary<String, Any> {