Search code examples
xcode10

How do I resolve "unexpected duplicate creator" when running xcodebuild test using the xcodebuild 10 beta?


An example of my build command and the resulting error:

xcodebuild -project foo.xcodeproj -scheme 'fooUITest' -sdk iphonesimulator12.0 build-for-testing SWIFT_COMPILATION_MODE=wholemodule  -derivedDataPath DerivedData -resultBundlePath result CONFIGURATION_BUILD_DIR=foo DEBUG_INFORMATION_FORMAT=dwarf -destination 'OS=11.0,id=someId'

results in

unexpected duplicate creator 'Ld Foo.framework/Foo normal x86_64' for node 'Foo.framework/Foo' with prior creator 'Ld Foo.framework/Foo normal x86_64' (in target 'Foo MacOS')

Solution

  • This indicates that there are multiple commands in your build which produce Foo.framework/Foo. They've been overwriting each other until now, but Xcode 10's new build system is stricter about catching these sorts of problems. In this case, the diagnostic currently only shows one of the targets creating this framework, unfortunately (Foo MacOS). That said, I expect that the build system should also output a diagnostic with "Multiple commands produce..." that lists both targets. Is that the case? You can read more about that diagnostic in the Xcode 10 help: https://help.apple.com/xcode/mac/current/#/dev14a2fd0c0