2

I found that the newly (iOS16 Xcode 14) introduced single-target watchOS app does not work when I try to implement it with XcodeGen.

I'm getting the following error:

Prepare build
note: Building targets in dependency order
error: Multiple commands produce '/Users/martin/Library/Developer/Xcode/DerivedData/WatchTestGen-eqtccuxbzqoyuncgwdiwyamlfkpb/Build/Products/Debug-watchsimulator/WatchTestWatch Watch App.app/WatchTestWatch Watch App'
    note: Target 'WatchTestWatch Watch App' (project 'WatchTestGen'): CopyAndPreserveArchs /Users/martin/Library/Developer/Xcode/DerivedData/WatchTestGen-eqtccuxbzqoyuncgwdiwyamlfkpb/Build/Products/Debug-watchsimulator/WatchTestWatch Watch App.app/WatchTestWatch Watch App
    note: Target 'WatchTestWatch Watch App' (project 'WatchTestGen') has a command with output '/Users/martin/Library/Developer/Xcode/DerivedData/WatchTestGen-eqtccuxbzqoyuncgwdiwyamlfkpb/Build/Products/Debug-watchsimulator/WatchTestWatch Watch App.app/WatchTestWatch Watch App'


Multiple commands produce '/Users/martin/Library/Developer/Xcode/DerivedData/WatchTestGen-eqtccuxbzqoyuncgwdiwyamlfkpb/Build/Products/Debug-watchsimulator/WatchTestWatch Watch App.app/WatchTestWatch Watch App'

Build failed    2022-08-30 16:41    1.2 seconds

I created a sample project with the failing project.yml here: https://github.com/MartinP7r/xcodegen-watch-sample

WatchTest.xcodeproj works fine while the generated WatchTestGen.xcodeproj does not.

This requires Xcode 14 beta.

I'd be very happy about any advice on where to look for errors in my project or otherwise.

Martin
  • 1,112
  • 1
  • 11
  • 31

1 Answers1

0

I was able to get this working. It seems like the target type should simply be application, not application.watchapp2 .

type: application
platform: watchOS
Joshua Moore
  • 620
  • 1
  • 5
  • 12
  • Thank you for your contribution. I did this too https://github.com/MartinP7r/xcodegen-watch-sample/blob/e69a6b7f6d016f8330ac0abc6472e96f164672f3/project.yml#L21 – Martin Feb 14 '23 at 04:00