An item with the same key has already been added

Unfortunately, without knowing how and where you’re setting the items that use the StandaloneOSX key, but evidently you have more than one of them. Can you find them in your code?

In some ways, your issue sounds similar to this one. Perhaps looking at that thread might reveal some possible lines of investigation?