Class is implemented in both /System/Library/... and /private/var/...

I have tried my app on severals devices but some of theme show this error in Xcode console:


objc[8430]: Class DeviceType is implemented in both /System/Library/PrivateFrameworks/DeviceIdentity.framework/DeviceIdentity (0x1b36a3908) and /private/var/containers/Bundle/Application/669AA1E2-7EC3-45B7-B4A2-BA187FC99643/app3.app/Frameworks/PVModel.framework/PVModel (0x101cfe6a0). One of the two will be used. Which one is undefined.


I believe that the `/System..` directory dose not have anything to do with my app and Xcode should not be looking class there.

I tried to set the search path in Xcode build settings, but the error still shows up

How can I answer to this "Which one is undefined." ? How can specify which one to be used ?

Or how can I prohibite Xcode from searching into directories outside the app bundle?


Rename your DeviceType to be something else.

Hi!, thanks for the replay,
Is there any other solution? like namespacing ? or something should be done from Xcode?

Very often that's a type of warning you can simply ignore.

There's something else going on here, I think. Linking your app in Xcode shouldn’t cause any references to be resolved to a framework in your currently installed macOS. Instead, it should be linking against framework definitions in the macOS SDK that Xcode provides. What SDK is your project set to use? (It's set in the build settings.)


However, if there is in fact a class name conflict, then there is no solution other than renaming your class. Your class is apparently an Obj-C class (if it was Swift, the name would be mangled), and the normal practice for Obj-C is to use a 3-letter prefix on all class names to prevent name clashes with other global symbols.


Edit: Oops, there was a typo in the second sentence that changed the meaning. it was supposed to be ”shouldn’t”, not “should”.

That is essentially what namespacing does. It is syntactic sugar that mangles the name for the linker. If you are using a language that supports namespacing, then that would be a solution. If not, you'll have to hack it up yourself with a prefix.

Class is implemented in both /System/Library/... and /private/var/...
 
 
Q